0%

What code would you use to tell if "schwifty" is of type String?

Correct! Wrong!

The runtime system starts your program by calling which function first?

Correct! Wrong!

Which is the most reliable expression for testing whether the values of two string variables are the same?

Correct! Wrong!

What can you use to create new instances in Java?

Correct! Wrong!

How can you achieve runtime polymorphism in Java?

Correct! Wrong!

You get a NullPointerException. What is the most likely cause?

Correct! Wrong!

What method signature will work with this code?boolean healthyOrNot = isHealthy("avocado");

Correct! Wrong!

How does the keyword `_volatile_` affect how a variable is handled?

Correct! Wrong!

By implementing encapsulation, you cannot directly access the class's properties unless you are writing code inside the class itself.

Correct! Wrong!

Which is the most up-to-date way to instantiate the current date?

Correct! Wrong!

Which are valid keywords in a Java module descriptor (module-infoJava)?

Correct! Wrong!

You have an ArrayList of names that you want to sort alphabetically. Which approach would NOT work?

Correct! Wrong!

Given the following definitions, which of these expression will NOT evaluate to true? `boolean b1 = true, b2 = false; int i1 = 1, i2 = 2;`

Correct! Wrong!

Which statement is NOT true?

Correct! Wrong!

How do you write a foreach loop that will iterate over ArrayList\pencilCase?

Correct! Wrong!

Correct output of `"apple".compareTo("banana")`

Correct! Wrong!

What statement returns true if "nifty" is of type String?

Correct! Wrong!

Given the string "strawberries" saved in a variable called fruit, what would `fruit.substring(2, 5)` return?

Correct! Wrong!

What method can be used to create a new instance of an object?

Correct! Wrong!

Which type of variable keeps a constant value once it is assigned?

Correct! Wrong!

Java Quiz
Well done!
Keep Coming Back For More Such Questions.

Leave a Comment