menu

Java Classes and Objects

Java Classes and Objects - Important Points


6. Which keyword is used to refer to the current object in Java?

A. this

B. super

C. final

D. abstract

Discuss Work Space

Answer: option a

Explanation:

The this keyword is used to refer to the current object in Java.

7. Which keyword is used to access the superclass in Java?

A. this

B. super

C. final

D. abstract

Discuss Work Space

Answer: option b

Explanation:

The super keyword is used to access the superclass in Java.

8. Which of the following is not a method in the Object class in Java?

A. toString()

B. hashCode()

C. equals()

D. clone()

Discuss Work Space

Answer: option d

Explanation:

The clone() method is not a method in the Object class in Java.

9. Which method is used to compare two objects for equality in Java?

A. toString()

B. hashCode()

C. equals()

D. compareTo()

Discuss Work Space

Answer: option c

Explanation:

The equals() method is used to compare two objects for equality in Java.

10. Which of the following is true about static methods in Java?

A. They can access instance variables directly.

B. They can be overridden in a subclass.

C. They cannot access instance variables directly.

D. They can only be called from an object of the class.

Discuss Work Space

Answer: option c

Explanation:

Static methods cannot access instance variables directly.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now