



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Amity School of Engineering
So, objects mainly serve the following purposes: Understanding of the real world problem and give the practical base for designers Decomposition of a problem into modules. Such decomposition is depends on the judgment and nature of the problem
The objects with the similar attributes and behavior (operations) are grouped into a Class.
or All those objects possessing similar properties are grouped into the same unit which is called as Class.
The concept of class-ing the real world objects is logically shown in the following figure
Objects and Classes^4
Person Objects
A class is a template (pattern) that unites data and operations.
A class is an abstraction of the real world entities with similar properties.
A class identifies a set of similar objects.
Ideally, the class is an implementation of abstract data type.
In C++ or JAVA, related objects displaying the same behavior are grouped and represented by class in the following way:
Example (C++ Class) Example (Java Class) class account { private: char Name(20]; int AccountType; // data members int AccountNumber; float Balance; public: Deposit(); Withdraw(); // member functions Enquire(); };
public class Account { private String name; private int accountType; // data Members private int accountNumber; private float balance;
public int deposit(); public void withdraw(); //member functions public String enquire(); }
C++ Object Creation JAVA Object Creation account savings_account; account current_account; account FD_account;
Account savings_account = new Account(); Account current_account= new Account(); Account FD_account= new Account();
Amity School of Engineering & Technology B.Tech., CSE(5th Sem.)