0% found this document useful (0 votes)
134 views1 page

Important Questions - Class & Objects

Uploaded by

Haniya Wasi
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)
134 views1 page

Important Questions - Class & Objects

Uploaded by

Haniya Wasi
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/ 1

Important Questions from Class and Objects

1. “Object is an instance of a class”, explain


Ans: Object of a class contains data and functions provided in a class. it possesses all the
features of a class. Hence object is termed as instance of a class.
2. What is an Object? [2006]
Ans: An Object is an identifiable entity with some characteristics and behavior. E.g. take a
class ‘Car’. A car class has characteristics like colour, gears, power, length etc. now we create
the object of that class ‘Car’ namely ‘Indica’.
3. What is OOP? What are the features/concepts in OOP’s? [2007]
Ans: The Object Oriented Programming Paradigm is the latest in the software development
and the most adopted one in the programming development. The Paradigm means
organising principle of a program. It is an approach to programming. The concepts of OOP’s
are: (1) Data Abstraction (2) Data Encapsulation (3) Modularity (4) Inheritance (5)
Polymorphism.
4. Explain all the Concepts of OOP’s?
Ans: Abstraction: It refers to the act of representing essential features without including the
background details or explanation. Encapsulation: It is the way of combining both data and
the function that operates on the data under a single unit. Modularity: It is the property of a
system that has been decomposed into a set of cohesive and loosely couple modules.
Inheritance: It is the capability of one class of thing to inherit properties from another class.
Polymorphism: It is the ability for a message or data to be processed in more then one form.
5. What is Class? How Object is related to the Class?
Ans: A Class represent a set of Objects that share common characteristics and behavior.
Objects are instance of a class. The Object represents the abstraction representation by the
class in the real sense.
6. What is the need of a class in Java?
Ans: Classes in Java are needed to represent real-world entities, which have data type
properties. Classes provide convenient methods for packing together a group of logical
related data items and functions that work on them. In java the data items are called fields &
the functions are called methods.
7. What are Methods? How are these related to an Objects?
Ans: A Method is an operation associated to an Object. The behavior of an Object is
represented through associated function, which are called Methods.
8. What is an abstraction?
Ans: An abstraction is a named collection of attributes and behaviors required to represent
an entity or concept for some particular problem domain.
9. What is inheritance and how it is useful in Java. [2008]
Ans: It is process by which objects of one class acquire the properties of objects of another
class. Inheritance supports the concepts of hierarchical representation. In OOP the concepts
of inheritance provides the idea of reusability.
10. What role does polymorphism play as java feature?
Ans: It mean the ability to take more than one form. For example, an operation, many types
of data used in the operation.
11. What is Data hiding?
Ans: Data Hiding means restricting the accessibility of data associated with an object in such
a way that it can be used only through the member methods of the object.

Class & Objects / Q & A Page 1

Important Questions from Class and Objects

12. Why is a class called an object factory?


Ans. A class is called an object factory because objects are created from a class. An object is
an instance of a class.
13. What does a class encapsulate?
Ans. A class encapsulates characteristics represented by data member and behaviour
represented by member methods.

Class & Objects / Q & A Page 2

You might also like