1. Which statement correctly creates an object from class Car in Java?
In Java you use the new keyword with a constructor call to instantiate an object: new Car(). Then you can assign it to a reference of type Car.
Get the Preplance app for a seamless learning experience. Practice offline, get daily streaks, and stay ahead with real-time interview updates.
Get it on
Google Play
4.9/5 Rating on Store
Google · Object Oriented Programming
Practice Object Oriented Programming questions specifically asked in Google interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
6
Tagged for this company + subject
Company
View company-wise questions
Subject
Object Oriented Programming
Explore topic-wise practice
Go through each question and its explanation. Use this page for targeted revision just before your Google Object Oriented Programming round.
In Java you use the new keyword with a constructor call to instantiate an object: new Car(). Then you can assign it to a reference of type Car.
For complete preparation, combine this company + subject page with full company-wise practice and subject-wise practice. You can also explore other companies and topics from the links below.
Method overriding lets a subclass modify or extend the behavior of a method inherited from the superclass. It supports runtime polymorphism. The method signatures must match exactly.
class Parent { void show(){} }
class Child extends Parent { void show(){ System.out.println("Child"); } }A parameterized constructor allows passing values at the time of object creation, so the object can be initialized with different states immediately.
A destructor is called automatically when an object goes out of scope or is delete-ed. It allows cleanup of memory, file handles, or other resources.
A default constructor takes no arguments; it either is provided implicitly or defined explicitly. A parameterised constructor takes one or more parameters for initialization. Example in Java: class Person { Person() { } Person(String name) { this.name=name; } } The difference influences how objects are created and initialised.
Constructor chaining means one constructor calls another in the same class (or base class) to reuse initialization logic. It helps avoid duplication and maintain consistent object setup.