Level Up Your  Java Knowledge with these Top Quiz Questions

A. The reference of the array  B. A copy of the array  C. Length of the array  D. Copy of the first element

1. When an array is passed to a method, what does the method receive?

Check out the answer here!

A. int[] A = {}  B. int[] A = {1, 2, 3}  C. int[] A = (1, 2, 3)  D. int[][] A = {1,2,3}

2. Select the valid statement to declare and initialize an array.

Check out the answer here!

A. At run time  B. At compile time  C. Depends on the code  D. None

3. When is the object created with a new keyword?

Check out the answer here!

4. In which of the following is the toString() method defined?

A. java.lang.Object  B. java.lang.String  C. java.lang.util  D. None

Check out the answer here!

5. To which of the following does the class string belong?

A. java.lang  B. java.awt  C. java.applet  D. java.string

Check out the answer here!

A. int  B. void  C. double  D. None

6. Identify the return type of a method that does not return any value.

Check out the answer here!

A. No return type  B. A class object in which it is defined  C. void  D. None

7. What is the implicit return type of the constructor?

Check out the answer here!

A. Solution(void)  B. Solution() public  C. Solution(void) public  D. Solution()

8. Identify the prototype of the default constructor - Public class Solution {}

Check out the answer here!

A. for(; ;)  B. for(int i = 0; i < 1; i--)  C. for(int i = 0; ;i++)  D. All of the above

9. Identify the infinite loop.

Check out the answer here!

A. Comparator  B. EventListener  C. Set  D. Collection

10. Identify the interface which is used to declare core methods in Java.

Check out the answer here!

Are you prepared to assess your knowledge of Java Programming?

Demonstrate your expertise by taking our quiz. Simply click on the "Try it now" button to commence. Best of luck!

Improve your Java Programming Skills with Scaler!

Sign up for Scaler's free masterclasses and events to learn about the latest trends in the IT industry and become a pro.  Don't hesitate any longer, register today!