A Small Test to Build Your Knowledge

Top 6 Java  Quiz Questions

A. Byte to int  B. Int to long  C. Long to int  D. Short to int

1. Automatic type conversion is possible in which of the possible cases?

Satisfy your curiosity & find out  the answers now!

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

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

Satisfy your curiosity & find out  the answers now!

A. True  B. False  C. An int value  D. None

3. compareTo() returns

Satisfy your curiosity & find out  the answers now!

A. 3  B. 3.0  C. 4  D. 4.0

4. Output of Math.floor(3.6)?

Satisfy your curiosity & find out  the answers now!

A. Object  B. Instance variables  C. Reference variable  D. None

5. What are the variables declared in a class for the use of all methods of the class called?

Satisfy your curiosity & find out  the answers now!

A. catch  B. throw  C. final  D. none

6. Exception created by a try block is caught in which block-

Satisfy your curiosity & find out  the answers now!

Are you  ready to test your knowledge of Java?

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

Looking to Elevate your Coding Skills?

Sign up for Scaler's free masterclasses and events to learn about the latest trends in the IT industry and become a pro.