What is the result of the following when called as java counting.MyClass?
package counting; import java.util.*; public class MyClass { ? public static void main(String... args) { Arrays.sort(args); System.out.println(Arrays.toString(args)); } }
B.
Since no arguments are passed from the command line, this creates an empty array.
Sorting an empty array is valid and results in an empty array.
Therefore, Option B is correct.