โ† All SCJP Flashcard Decks

Java OOP and Inheritance Flashcards

6 cards from real SCJP practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 Java OOP and Inheritance flashcards as text
  1. Which statement about Java interfaces is correct for SCJP?

    Answer: Interface fields are public static final by default

    All fields declared in an interface are implicitly `public static final` (constants).

  2. What is encapsulation in Java?

    Answer: Hiding implementation by restricting direct access to fields and exposing via methods

    Encapsulation bundles data and methods together while restricting direct field access, typically using private fields and public getters/setters.

  3. What does the `instanceof` operator return when the reference is null?

    Answer: false

    `null instanceof AnyClass` always returns `false` without throwing an exception.

  4. In Java, can a class implement more than one interface?

    Answer: Yes, with a comma-separated list

    A Java class can implement multiple interfaces by listing them with commas: `class Foo implements A, B, C`.

  5. Which of the following correctly defines a constructor in Java?

    Answer: It has the same name as the class and no return type

    A constructor shares the class name and has no return type declared (not even void).

  6. What is the effect of marking a class member as `private`?

    Answer: Accessible only within the declaring class

    `private` is the most restrictive access modifier, limiting access to only the class in which the member is declared.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy