What will the following lines print?
int[] array = {1,2}; 
System.out.println(array);
Explanation
Array object does not print its content by default, just like any other object in java it prints array class identifier followed by hex hashcode .

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
Java quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes