Home » JAVA Programming » Packages » Question
  1. What is the output of this program?
     package pack;
    public class Result
    {
    public static void main(String args[])
    {
    StringBuffer strbuf = new StringBuffer("Hello Mania");
    strbuf.insert(6 , "Interview ");
    System.out.println(strbuf);
    }
    }
    1. Hello Mania
    2. Mania
    3. Interview
    4. Hello Interview Mania
    5. None of these
Correct Option: D

Since Result.class file is not in the directory pkg in which class Result is defined, program will not be able to run.



Your comments will be displayed only after manual approval.