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

Java Chapter 8: Classes and Objects Quiz

Created by
@SharpestAspen

Questions and Answers

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

static

What operator creates an object and returns its reference?

new

Which type of method can be called without creating an instance of a class?

Class method

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

Use Quizgecko on...
Browser
Browser