What will the following program print when compiled and run:
public class Main { public static void main (String [] args) { someMethod (); } static void someMethod (Object parameter) { System.out.println ("Value is "+parameter); } }
Select 1 option
Correct Option is : A
To call someMethod
(Object parameter), you must pass exactly one parameter.
So someMethod()
is not a valid call to this method and the code will not compile.
Note that parameter will not be assigned a null or default value.