Object, class and method


Object, Class and Method

By Nishant Kumar

Explain an object.

An object is an entity that keeps together state and behaviors. For instance, a car encapsulates state such as red color, 900 cc etc and behaviors as 'Start', 'Stop' etc., so does an object.

An object is an instance of a class. If you consider “Dog” as a class, it will contain all possible dog traits, while object “German Shepherd” contains characteristics of specific type of dog.

Define a class.

A class represents description of objects that share same attributes and actions. It defines the characteristics of the objects such as attributes and actions or behaviors. It is the blue print that describes objects. 

What is Method? 

Method is an object’s behavior. If you consider “Dog” as an object then its behaviors are bark, walk, run etc.  

Oops - Object, classes and methods - Jan 12, 2009 at 11:14 AM by Vidya Sagar

Why are classes important?

A class is the fundamental entity in OOP. The functionality, data need to be well defined in a class. The need, flow and actual functionality is to be well defined, structured in a class first, without which OOP can not be done.

Explain the desirable qualities of an object.

An object must instantiate a well defined class. Using an object the following features should be adhered

Modularity: The operations / methods should be defined separately for each module of the software project. One of the objects’ features can be used by other object as a reusable component.

Information Hiding: The data about one object should exclusively belong to that object, which enables the individual modules focuses on specific functionality.

Re-usability of code: An object of one class should have the same functionality that of another. Same code could be usable by all objects of one class. There should not be mismatching of the functionality of one object to that of another.

Object Oriented Programming Interview Questions

Related Link

>Learn JavaScript's OOP features

Concurrency with AOP

Concurrency is the system's ability to act with several requests simultaneously, such a way that threads don't corrupt the state of objects when they gain access at the same time............

Transparent caching with AOP 

To get better results in terms of speed and resources used, it's suggested to use a cache. We can store in it the results corresponding to the methods' invocations as key-value pairs: method and arguments as key and return object as value..............

Security with AOP

Security is one of the most important elements of an application. The word "security" covers two concepts: Authentication is the verifi cation's process of a principal's identity; a principal is typically a user. A principal in order to be authenticated provides a credential that is the password. Authorization, on the other hand, is the process of granting authorities, which are usually roles, to an authenticated user...........


What is the relation between Classes and Objects? Explain different properties of Object Oriented Systems. What is difference between Association, Aggregation and Inheritance relationships? Explain the features of an abstract class in NET. Difference between abstract classes and interfaces Similarities and difference between Class and structure in .NET Features of Static/Shared classes. What is Operator Overloading in .NET?.............

What is object oriented programming (OOP)?

The object oriented programming is commonly known as OOP. Most of the languages are developed using OOP concept. Object-oriented programming (OOP) is a programming concept that uses "objects" to develop a system.........

Write your comment - Share Knowledge and Experience

Latest placement tests
Latest links
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us