InstructionsTotal Questions: 20Total Minutes: 20This ExamTray Free Online Test or Quiz or Trivia tests your Programming Skills on basics of Java Command Line Arguments. This test displays answers after finishing the exam for review. You can easily clear Competitive Exams and Job Interview Questions. Students can learn Java basics. Go through Java Theory Notes on Command Line Arguments before attempting this test. All the Best Challenge SCORE0 / 20Take This Exam 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*Q Buttons 1) A command-line argument in Java is a value passed at the time of ___ a program. A) Compiling B) Running C) - D) - 2) Command-line arguments help in a way of ____ data to a program. A) Inputting B) Outputting C) - D) - 3) The command-line arguments are passes at ____. A) Runtime B) the time of executing a Java program. C) the time of compiling a Java program. D) None 4) When a Java program is executed once, how many times can you pass data using the Command-line arguments? A) 1 B) 8 C) 16 D) None 5) If you need to accept data at runtime, you use ___ in Java. A) Command-line arguments B) Java IO statements C) - D) - 6) Which is the method that accepts data passed in the form of command-line arguments in Java? A) show() method B) main() method C) display() method D) print() method 7) The command-line arguments in Java are used along with a ____ command. A) javac B) java or javaw C) javap D) All the above Ad 8) The type of Arguments the MAIN method accepts is ___. A) Integer[] B) Float[] C) Long[] D) String[] 9) The data that is passed at the time of running a Java program as command-line arguments are converted into ___ data type. A) Integer array B) Float array C) Character array D) String array 10) The delimiter used to separate command-line arguments in Java is ____. A) Semicolon (;) B) Colon (:) C) Space D) Comman (,) 11) Can you pass a sentence with multiple words separated by spaces as a single command-line argument in Java? A) Yes B) No C) - D) - 12) What is the output of the below Java program with command-line arguments? public class CommandLineArgs1 { public static void main(String[] args) { for(String str: args) { System.out.println(str); } if(args.length == 0) System.out.println("No arguments passed"); } c:\folder>java CommandLineArgs1 car brake horn A) car brake horn B) car brake horn C) horn brake car D) horn brake car 13) Is there any limit to the number of spaces between two arguments of command-line arguments in Java? A) Yes B) No C) - D) - 14) To pass a string as a command-line argument in Java, you need to surround the text within a pair of ___. A) Single Quotes ('abc def') B) Double Quotes ("abc def") C) Double Spaces( abc def ) D) Triple Single Quotes ('''abc def''') Ad 15) Choose the correct way of receiving command-line arguments with in the MAIN method in Java? A) public static void main(String[] args) { } B) public static void main(String args[]) { } C) public static void main(String anyName[]) { } D) All the above. 16) what is the output of the below Java program with command-line arguments? public class CommandLineArguments2 { public static void main(String[] args) { System.out.println(args[1]); } } C:\folder>java CommandLineArguments2 TIGER A) CommandLineArguments2 B) TIGER C) Compiler error D) None 17) Which is the exception or error that is thrown if a non-existing command-line argument is referred to in a Java program? A) StackOverflowError B) IndexOutOfBoundsException C) ArrayIndexOutOfBoundsException D) ArithmeticException 18) Any type of data that can be typed on a console or ECLIPSE can be passed as a command-line argument. State TRUE or FALSE. A) TRUE B) FALSE C) - D) - 19) Which are the methods used to parse string values to the respective data types in Java? A) Boolean.parseBoolean(), Byte.parseByte() B) Integer.parseInt(), Long.parseLong() C) Float.parseFloat(), Double.parseDouble() D) All the above 20) What is the output of the below Java program? public class CommandLineArguments3 { public static void main(String[] args) { String name = args[0]; int age = Integer.parseInt(args[1]); Boolean married = Boolean.parseBoolean(args[2]); Float salary = Float.parseFloat(args[3]); System.out.println("Name="+name + ", Age=" + age + ", Married=" + married + ", Salary=$"+ salary); } } C:\folder>java CommandLineArguments3 Marker 25 false 5025.35 A) Name=Marker, Age=25, Married=false, Salary=$5025.35 B) Name=Marker, Age=25, Married=false, Salary=$5025 C) Compiler error D) None FINISH EXAM 1*2*3*4*5*6*7*8*9*10*11*12*13*14*15*16*17*18*19*20*PREV Java Recursion Online Test NEXT Java Varargs Online Test