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
Amazon · Object Oriented Programming
Practice Object Oriented Programming questions specifically asked in Amazon interviews – ideal for online test preparation, technical rounds and final HR discussions.
Questions
8
Tagged for this company + subject
Company
Amazon
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 Amazon 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();Inheritance allows a class (child) to reuse and extend the functionality of another class (parent). It promotes code reuse and hierarchical classification.
class Animal { void eat(){} }
class Dog extends Animal { }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.
Static members belong to the class itself and are shared across all objects; instance members are part of each object’s state and vary from object to object.
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(){} }