Skip to content
Pass Any WGU OA Exam Now & Pay After You Pass. Contact Us!
  1. Home
  2. WGU Exams
  3. WGU D286
  4. Set 4
WGU D286 · Java Fundamentals

WGU D286 Practice Questions – Set 4

50 multiple-choice questions with answers and detailed explanations. Untimed — choose an answer to check it instantly.

Question 1 of 50

What is inheritance used to achieve in object-oriented design?

Question 2 of 50

What is an 'is-a' relationship?

Question 3 of 50

When should composition be used instead of inheritance?

Question 4 of 50

Can a subclass access private members of its superclass directly?

Question 5 of 50

What happens when a subclass overrides a method and calls super.method()?

Question 6 of 50

Can a final method be overridden in a subclass?

Question 7 of 50

What is an abstract method?

Question 8 of 50

Can a class containing an abstract method be instantiated?

Question 9 of 50

What is the benefit of declaring a variable using a superclass type?

Question 10 of 50

In polymorphism, which method implementation executes at runtime?

Question 11 of 50

What is the Object class method used to compare logical equality?

Question 12 of 50

What contract must hashCode() satisfy?

Question 13 of 50

What is a marker interface?

Question 14 of 50

What is a functional interface?

Question 15 of 50

What is a lambda expression used for in Java?

Question 16 of 50

What does the Iterator interface provide?

Question 17 of 50

Why should you use an Iterator's remove() method rather than modifying a collection during a for-each loop?

Question 18 of 50

What is the difference between ArrayList and LinkedList?

Question 19 of 50

What does the Collections.sort() method require of the elements?

Question 20 of 50

What is the difference between Comparable and Comparator?

Question 21 of 50

What is a checked exception example in Java?

Question 22 of 50

What does the throws clause in a method declaration indicate?

Question 23 of 50

Can a single try block have multiple catch blocks?

Question 24 of 50

What happens if a catch block for a superclass exception is placed before a subclass exception catch?

Question 25 of 50

What is a custom exception in Java?

Question 26 of 50

What is the purpose of the Serializable interface?

Question 27 of 50

What is a stream in the Java Collections context?

Question 28 of 50

What does the filter() operation on a stream do?

Question 29 of 50

What does the map() operation on a stream do?

Question 30 of 50

What is the significance of streams being lazy?

Question 31 of 50

What is the purpose of the Optional class?

Question 32 of 50

What is a thread in Java?

Question 33 of 50

Which method starts a new thread's execution?

Question 34 of 50

What is a race condition?

Question 35 of 50

What does the synchronized keyword provide?

Question 36 of 50

Why are immutable objects inherently thread-safe?

Question 37 of 50

What is the purpose of the java.util.Random class?

Question 38 of 50

What does the LocalDate class represent?

Question 39 of 50

What is the advantage of the java.time API over the older Date class?

Question 40 of 50

What is the purpose of an anonymous inner class?

Question 41 of 50

What does the enhanced switch expression (Java 14+) provide over the traditional switch?

Question 42 of 50

What is a record in modern Java?

Question 43 of 50

What is the purpose of the var keyword introduced in Java 10?

Question 44 of 50

What is a common cause of a StackOverflowError?

Question 45 of 50

What is an OutOfMemoryError typically caused by?

Question 46 of 50

What is a memory leak in a garbage-collected language like Java?

Question 47 of 50

What is the purpose of unit testing frameworks such as JUnit?

Question 48 of 50

What does an assertion in a unit test verify?

Question 49 of 50

What is the value of writing tests before or alongside implementation?

Question 50 of 50

What is the single most important habit for writing maintainable Java code?

Set 4 complete

You scored 0%

0 correct out of 0 answered (50 questions in this set).

Next: Set 5

Struggling with WGU D286?

If this exam is giving you a hard time, let us be your helping hand. Contact us, and we'll provide the assistance you need to pass and move forward.

Chat Now