Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Object-Oriented Programming: Understanding Objects and Classes, Study notes of Computer Networks

An introduction to object-oriented programming (oop) with a focus on objects and classes. Objects are treated as entities in the real world, and they serve to understand problems and decompose them into modules. Every object consists of attributes and behaviors, which are represented as data members and member functions, respectively. Similar objects are grouped into classes, which act as templates for creating objects. The document also discusses the advantages and disadvantages of using oop, including encapsulation, data abstraction, inheritance, and polymorphism.

Typology: Study notes

2014/2015

Uploaded on 02/26/2015

unknown user
unknown user 🇮🇳

4.5

(11)

5 documents

1 / 7

Toggle sidebar

Related documents


Partial preview of the text

Download Object-Oriented Programming: Understanding Objects and Classes and more Study notes Computer Networks in PDF only on Docsity! 1 Java Programming Topic: Object & Class Theory ANIL SAROLIYA Amity School of Engineering B.Tech., CSE(5th Sem.) Objects  Following figure shows few entities and each of them can be treated as an object. So we can say, an object can be a person, a place, or a thing with which the computer must deal. 2  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 Classes Cont..  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: 5 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(); Advantages & Disadvantages of OOP’s 6 MERITS DEMERITS Supports Following: Encapsulation Data Abstraction Inheritance Polymorphism Related to Real world entity Compiler overhead Runtime overhead Re-orientation of software developer to object-oriented thinking Requires the mastery over the following areas: Software Engineering Programming Methodologies Benefits only in long run while managing large software projects Thanks 7 Amity School of Engineering & Technology B.Tech., CSE(5th Sem.)