Top 25 Java Quiz Questions – A Small Test to Build Your Knowledge

1. Top Java Quiz Questions

Till now, you gained the complete knowledge of Java programming language. So, be ready to test your knowledge with this “Java quiz questions”. Here, we are providing you with some multiple choice questions of Java with answers. This java quiz will help you to brush up Java concepts.

Before we start our Java quiz, let’s revise Java Tutorial.

Java Quiz

Top 25 Java Quiz Questions

Q.1 What will be the output of the following code

Java Quiz Q.1
Correct! Wrong!

Q.2 What will be the output of the following code

Java Quiz One Q.2
Correct! Wrong!

Q.3 What will be the output of the following code

Java Quiz One Q.4
Correct! Wrong!

Q.4 What will be the output of the following code -

Java Quiz One Q.5
Correct! Wrong!

Q.5 Which of those doesn't have an index based structure?

Correct! Wrong!

Q.6 java.util.Collections is a:

Correct! Wrong!

Q.7 Methods such as reverse, shuffle are offered in:

Correct! Wrong!

Q.8 Which of those allows duplicate elements?

Correct! Wrong!

Q.9 Which allows the storage of a null key and null values?

Correct! Wrong!

Q.10 What will be the output of the following code

Java Quiz One Q.11
Correct! Wrong!

Q.11 What will be the output of the following code

Java Quiz One Q.12
Correct! Wrong!

Q.12 What will be the output of the following code

Java Quiz One Q.13
Correct! Wrong!

Q.13 What will be the output of the following code

Correct! Wrong!

Join DataFlair on Telegram

Q.14 What will be the output of the following code

Java Quiz One Q.15
Correct! Wrong!

Q.15 What will be the output of the following code

Java Quiz One Q.16
Correct! Wrong!

Q.16 What will be the output of the following code

Java Quiz One Q,18
Correct! Wrong!

Q.17 What will be the output of the following code

Java Quiz One Q.19
Correct! Wrong!

Q.18 What will be the output of the following code

Java Quiz One Q.21
Correct! Wrong!

Q.19 What will be the output of the following code

Java Quiz One Q.22
Correct! Wrong!

Q.20 Which interface should be implemented for sorting on basis of many criteria’s?

Correct! Wrong!

Q.21 What will be the output of the following code

Java Quiz One Q.24
Correct! Wrong!

Q.22 What will be the output of the following code

Correct! Wrong!

Q.23 In ConcurrentHashMap - once thread locks one segment for updation it doesn't block it for retrieval hence another thread will scan the same segment, however, it'll be ready to read the data before locking?

Correct! Wrong!

Q.24 In ConcurrentHashMap - once thread locks one segment for updation it doesn't allow the other thread to perform updations in the same segment till lock isn't released on the segment

Correct! Wrong!

See also – 

Java Quiz Part 2

Java Quiz Part 3

5 Responses

  1. Akila T says:

    I’m not getting my score. Help please.

    • DataFlair Team says:

      Hi Akila,
      Thanks for taking this Java Quiz. We have checked the Quiz and all its settings, everything is working fine. Please ensure you filled all the answers (mandatory), and after submitting your email id, you will get your score on the screen with the answers you have provided.
      Regards,
      DataFlair

  2. Ajith says:

    is that the 14th question’s answer is correct? can you explain to me why?

  3. ancy says:

    can you explain how did you get the answer to the 14th question?

  4. Bhuvaneswari says:

    in that program they have cleared thelist in the 4th line list clear()
    so the actuall initial values are totally washed out then the further values are stored.so that the size is 2 i guess

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.