What would be the result of trying to compile and run the following program?
public class Main{ int [] myArray = new int [1]; Object myObject [] = new Object [1]; boolean bool; public static void main (String args []){ Main test = new Main (); System .out.println (test.myArray [0] + " " + test.myObject [0]+" "+test.bool); } }
Select 1 option
Correct Option is : C
Following are the default values that instance variables are initialized with if not initialized explicitly:
types (byte, short, char, int, long, float, double) to 0 ( or 0.0 ).
All Object types to null.
boolean to false.