273). Which of this method is given parameter via command line arguments?

[A]main()
[B]recursive() method
[C] Any method
[D]System defined methods

Show Answer

276). Which of these is a correct statement about args in the following line of code?
public static void main(String args[])

[A]args is a String
[B]args is a Character
[C]args is an array of String
[D]args in an array of Character

Show Answer

277). Can command line arguments be converted into int automatically if required?
public static void main(String args[])

[A]Yes
[B]No
[C]Compiler Dependent
[D]Only ASCII characters can be converted

Show Answer

278). What will be the output of the following Java program, Command line execution is done as – “java Output This is a command Line”?
    class Output 
    {
        public static void main(String args[]) 
        {
            System.out.print(args[0]);
        }
    }

[A]java
[B]Output
[C]This
[D]is

Show Answer

279). What will be the output of the following Java program, Command line exceution is done as – “java Output This is a command Line”?
    class Output 
    {
        public static void main(String args[]) 
        {
            System.out.print(args[3]);
        }
    }

[A]java
[B]is
[C]This
[D]command

Show Answer

280). What will be the output of the following Java program, Command line execution is done as – java Output “This is a command Line”?
    class Output 
    {
        public static void main(String args[]) 
        {
            for (String arg : args)
            {
                System.out.print(arg);
            }
        }
    }

[A]This
[B]java Output This is a command Line
[C] This is a command Line
[D]Compilation Error

Show Answer

281). What will be the output of the following Java program, Command line execution is done as – “java Output command Line 10 A b 4 N”?
    class Output 
    {
        public static void main(String args[]) 
        {
            System.out.print((int)args[2] * 2);
        }
    }

[A]java
[B]10
[C]20
[D]error

Show Answer

282). What will be the output of the following Java program, Command line execution is done as – “java Output command Line 10 A b 4 N”?
    class Output 
    {
        public static void main(String args[]) 
        {
            System.out.print(args[6]);
        }
    }

[A]java
[B]10
[C]b
[D]N

Show Answer