11.
What will be the output of the following Java program?
class Output 
{
    public static void main(String args[])
    {
        int a1[] = new int[10];
        int a2[] = {1, 2, 3, 4, 5};
        System.out.println(a1.length + " " + a2.length);
    } 
}

12.
What will be the output of the following Java program?
class box 
{
    int width;
    int height;
    int length;
    int volume;
    void volume(int height, int length, int width) 
    {
         volume = width * height * length;
    } 
}    
class Prameterized_method{
    public static void main(String args[]) 
    {
        box obj = new box();
        obj.height = 1;
        obj.length = 5;
        obj.width = 5;
        obj.volume(3, 2, 1);
        System.out.println(obj.volume);        
    } 
}

15.
What will be the output of the following Java snippet, if attempted to compile and run this code with command line argument "java abc Ram Shyam"?
public class abc
{
	int a=2000;
        public static void main(String argv[])
        {
	    System.out.println(argv[1]+" :-Please pay Rs."+a);
        }
}

17.
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]);
    }
}

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

Read More Section(Miscellaneous in Java)

Each Section contains maximum 100 MCQs question on Miscellaneous in Java. To get more questions visit other sections.