JAVA QUIZ
1 .
Which of these are legal array declarations or definitions?

Correct Answer : Option (A)

int[] []x[];
  Show Answer
2 .
What is printed by code below?
 
String[] array = {"1","2","4","5"};
int i = array.length;
for(String x : array)i++;
System.out.println(i);

Correct Answer : Option (B)

8
  Show Answer
3 .
The last value in an array called ar can be found at index:

Correct Answer : Option (D)

Ar.length - 1
  Show Answer
4 .
A class is...

Correct Answer : Option (B)

An abstract definition of an object
  Show Answer
5 .
In java, float takes _________ bytes in memory.

Correct Answer : Option (B)

4
  Show Answer
6 .
What is the size of long variable?

Correct Answer : Option (D)

64 bit
  Show Answer
7 .
What will be printed?
String s1 = "a";
String s2 = s1;
s1 += "b";
System.out.println(s2);‚Äč

Correct Answer : Option (A)

a
  Show Answer
8 .
What are the functions of the dot(.) operator ?

Correct Answer : Option (D)

All of the above
  Show Answer
9 .
The most common use of an array is to:

Correct Answer : Option (C)

Perform the same operation on all elements in array
  Show Answer
10 .
How to sort an array?

Correct Answer : Option (B)

Arrays.sort()
  Show Answer