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
Microsoft · Object Oriented Programming
Practice Object Oriented Programming questions specifically asked in Microsoft interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
9
Tagged for this company + subject
Company
Microsoft
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 Microsoft 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.
A class acts as a blueprint that defines structure and behavior, while an object is a concrete instance created from that blueprint. You can create multiple objects from a single class.
class Car { }
Car c1 = new Car();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"); } }OOP aims to reduce redundancy, not increase it. Its modular design improves maintainability, reusability, and security by organizing code around real-world entities.
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.
In Java the == operator checks if two references refer to the same object in memory, not if they are logically equal. equals() checks content equality if overridden.
Polymorphism means 'many forms'. It allows the same method name or operator to behave differently depending on the object or context, such as method overloading (compile time) or overriding (runtime).
class Shape { void draw(){} }
class Circle extends Shape { void draw(){} }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.