Java - Quiz


Question 1:

How many arguments can be passed to main()?

Login to view solution
Question 2:

If MyProg.java were compiled as an application and then run from the command line as :-

java MyProg I like programming

What would be the value of args[1] inside the main( ) method?

Login to view solution
Question 3:

Given code snippet

public class Main {
     public static void main(String... str){ 
        Double double = str[0];
        System.out.println("Command Line Argument :" + double );
}
}

What will be the output if it is executed using Command Line Argument :- java Main  1.5 

Login to view solution

Share Quiz

Comments

Comments
comments powered by Disqus

Navigation

Social Media