Java Chapter 8: Classes and Objects Quiz
12 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which keyword is used to declare Class variables and class methods?

  • static (correct)
  • public
  • private
  • package
  • What operator creates an object and returns its reference?

  • assignment (=)
  • dot (.)
  • new (correct)
  • colon (:)
  • Which type of method can be called without creating an instance of a class?

  • Class method (correct)
  • Constructor method
  • Instance method
  • All of these
  • What refers to more than one method having the same name but different parameters?

    <p>Overloaded methods</p> Signup and view all the answers

    Which method is invoked automatically with the creation of an object?

    <p>Constructor</p> Signup and view all the answers

    Which keyword is used to refer to a superclass constructor in a subclass constructor?

    <p>super</p> Signup and view all the answers

    Which method of a Java class is invoked automatically with the creation of an object?

    <p>Constructor</p> Signup and view all the answers

    What is the keyword used in Java to call the constructor of the superclass in the constructor of a subclass?

    <p>Super</p> Signup and view all the answers

    How many levels of visibility are used to protect a method or variable from unauthorized reference in Java?

    <p>2</p> Signup and view all the answers

    In Java, what component generally makes up a class?

    <p>Both (A) and (B)</p> Signup and view all the answers

    Which operator in Java allows access to instance variables and instance methods?

    <p>. (Full stop)</p> Signup and view all the answers

    What differentiates a Constructor from a general method in Java?

    <p>All of these</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser