Knowee
Questions
Features
Study Tools

Select the correct answerWhat will be the output of the following Java snippet, if compiled and executed with command line “hello there”?public class abc{  String[] xyz;   public static void main(String argv[])  {    xyz=argv;  }   public void runMethod()  {    System.out.println(argv[1]);  }}OptionsOutput would be “there”Output would be “hello”Compile time errorOutput would be “hello there”

Question

Select the correct answerWhat will be the output of the following Java snippet, if compiled and executed with command line “hello there”?public class abc{  String[] xyz;   public static void main(String argv[])  {    xyz=argv;  }   public void runMethod()  {    System.out.println(argv[1]);  }}OptionsOutput would be “there”Output would be “hello”Compile time errorOutput would be “hello there”

🧐 Not the exact question you are looking for?Go ask a question

Solution

Compile time error

Similar Questions

Select the correct answerWhat is the output of following Java program?import static java.lang.System.*;class ProgrammingInJava { public static void main(String args[]) { out.println("Welcome!"); }}OptionsRuntime ErrorCompiler ErrorWelcome!None of these

Select the correct answerPredict the output of following Java program.?class CT {      public static void main(String args[]) {               int a;               System.out.println(a);     }   } Optionscompiler errorgarbage value0runtime error

Select the correct answerWhat will be the output of the following Java program?class main_class   {    public static void main(String args[])    {      int code = 10;      if (code == 10)       {         int code = 6;        System.out.println(code);      }    }   }OptionsCompilation error610Runtime error

Select the correct answerWhat will be the output of the following Java program? class CT {  public static void main(String args[]) {     try {      int X, Y;      Y = 0;      X = 5 / Y;      System.out.print("A");    }    catch(ArithmeticException e) {  System.out.print("B");    }    finally {     System.out.print("C");    }  } }OptionsBAACBC

Select the correct answerWhat will be the output of the following Java program?class exception_handling   {    public static void main(String args[])     {      try       {        System.out.print("Hello" + " " + 1 / 0);      }      catch(ArithmeticException e)       {     System.out.print("World");           }    }  }OptionsHelloWorldHelloWorldHello World

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.