Which two will compile, and can be run successfully using the command: Java fred1 hello walls

Which two will compile, and can be run successfully using the command: Java fred1 hello
walls

Which two will compile, and can be run successfully using the command: Java fred1 hello
walls

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 4

Your email address will not be published. Required fields are marked *


imyrta

imyrta

Answer: C, D

Explanation:

B will compile but will fail while running because based on the numbers of args will throw an ArrayIndexOutOfBoundsException.

A will not compile because the type of argument declared for the main method is String and in the system out is trying to use it as an array.