0% found this document useful (0 votes)
2 views2 pages

Core Java - OOP Concepts Initial OOP Interview

The document provides over 50 categorized interview questions related to Object-Oriented Programming (OOP) concepts, including topics like constructors, inheritance, and polymorphism. It explains the object-oriented paradigm, defining objects and their characteristics, and differentiates between object-oriented and object-based programming languages. Additionally, it notes that instance variables for object references in Java are automatically initialized to null by default.

Uploaded by

amitvani2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Core Java - OOP Concepts Initial OOP Interview

The document provides over 50 categorized interview questions related to Object-Oriented Programming (OOP) concepts, including topics like constructors, inheritance, and polymorphism. It explains the object-oriented paradigm, defining objects and their characteristics, and differentiates between object-oriented and object-based programming languages. Additionally, it notes that instance variables for object references in Java are automatically initialized to null by default.

Uploaded by

amitvani2024
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Core Java - OOP Concepts: Initial OOP Interview

Questions
There is given more than 50 OOP (Object-Oriented Programming and System)
interview questions. However, they have been categorized in many sections
such as constructor interview questions, static interview questions,
Inheritance Interview questions, Abstraction interview questions,
Polymorphism interview questions, etc., for better understanding.

23) What is an object-oriented paradigm?


It is a programming paradigm based on objects having data and methods
defined in the class to which it belongs. Key principles of the object-oriented
paradigm include encapsulation, inheritance, and polymorphism, providing a
framework for designing and structuring software in a way that models
real-world entities and promotes code reusability and maintainability. Objects
are the instances of classes that interact with one another to design
applications and programs.

There are the following features of the object-oriented paradigm.

○​ OOPs follows the bottom-up approach in program design.


○​ Focus on data with methods to operate upon the object's data
○​ Includes concepts like Encapsulation and abstraction, which hide the
complexities from the user and show only functionality.
○​ Implements the real-time approach like inheritance, abstraction, etc.

The examples of the object-oriented paradigm are C++, Simula, Smalltalk,


Python, C#, etc.

To read more: OOPs (Object-Oriented Programming) Concepts in Java

24) What is an object?


The Object is a real-time entity having some state and behavior. In Java, an
Object is an instance of a class that has instance variables as the state of the
object and methods as the behavior of the object. The object of a class can be
created by using the new keyword.
For example, if we have a class called Car, an object of that class could
represent a specific car with attributes like color, model, year, and methods
like startEngine() or drive(). Each instance of the Car class would be a distinct
object with its own unique state.

To read more: Java Classes & Objects

25) What is the difference between an object-oriented


programming language and an object-based programming
language?
There are the following basic differences between object-oriented languages
and object-based languages.

Object-oriented languages follow all the concepts of OOP, whereas


object-based languages do not follow all the concepts of OOP, like inheritance
and polymorphism. It allows the creation of classes and objects, and it
supports the defining and implementation of methods within those classes.

Object-oriented languages do not have the inbuilt objects, whereas


Object-based languages have the inbuilt objects; for example, JavaScript has
the window object. It allows the creation of objects and encapsulation of data,
but it might not provide the complete set of features associated with full OOP.

Examples of object-oriented programming are Java, C#, Smalltalk, etc.,


whereas the examples of object-based languages are JavaScript, VBScript,
etc.

26) What will be the initial value of an object reference


that is defined as an instance variable?
In Java, when an object reference is declared as an instance variable (a
member variable of a class). It is automatically initialized to null by default. It
is true for all object references, regardless of the class type.

You might also like