Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to declare the main method that accepts command line arguments.
Java
public static void [1](String[] args) { }🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
2fill in blank
mediumComplete the code to print the first command line argument.
Java
System.out.println(args[1]);🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
3fill in blank
hardFix the error in the main method declaration to accept command line arguments.
Java
public static void main([1] args) { }🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
4fill in blank
hardFill both blanks to declare the main method with command line arguments and print the number of arguments.
Java
public static void [1](String[] [2]) { System.out.println([2].length); }
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
5fill in blank
hardFill all three blanks to declare main, access the second argument, and print it.
Java
public static void [1](String[] [2]) { System.out.println([2][3]); }
🎯 Drag options to blanks, or click blank then click option
Attempts:
3 left
