Java Chapter 8: Classes and Objects Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

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 (A)</p> Signup and view all the answers

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

<p>Constructor (C)</p> Signup and view all the answers

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

<p>super (D)</p> Signup and view all the answers

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

<p>Constructor (D)</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 (C)</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 (B)</p> Signup and view all the answers

In Java, what component generally makes up a class?

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

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

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

What differentiates a Constructor from a general method in Java?

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

Flashcards are hidden until you start studying

More Like This

Use Quizgecko on...
Browser
Browser