Object Oriented Concepts
Class & Objects in C++
Constructor & Destructors in C++
Operator Overloading in C++
Friend function in C++
Data Conversion in C++
This pointer in C++
Friend class in C++
Nested Class in C++
This document provides an introduction to object-oriented programming (OOP) concepts. It defines OOP as a design philosophy that groups everything as self-sustainable objects. The key OOP concepts discussed are objects, classes, encapsulation, abstraction, inheritance, polymorphism, method overloading, method overriding, and access modifiers. Objects are instances of classes that can perform related activities, while classes are blueprints that describe objects. Encapsulation hides implementation details within classes, and abstraction focuses on what objects are rather than how they are implemented.
C++ [ principles of object oriented programming ]Rome468
C++ is an enhanced version of C that adds support for object-oriented programming. It includes everything in C and allows for defining classes and objects. Classes allow grouping of related data and functions, and objects are instances of classes. Key concepts of OOP supported in C++ include encapsulation, inheritance, and polymorphism. Encapsulation binds data and functions together in a class and allows hiding implementation details. Inheritance allows defining new classes based on existing classes to reuse their functionality. Polymorphism enables different classes to have similarly named functions that demonstrate different behavior.
This document discusses object-oriented design principles including encapsulation, abstraction, inheritance, polymorphism, and decoupling. It then introduces the SOLID principles of object-oriented design: single responsibility principle, open/closed principle, Liskov substitution principle, interface segregation principle, and dependency inversion principle. Code examples are provided to demonstrate how to apply these principles and improve code maintainability, reusability, and testability.
This document outlines the course description, textbook references, and lecture topics for an Object Oriented Programming course (OOP CCS-203) offered in the spring 2014 semester by the Department of Computer Science at COMSATS Institute of Information Technology. The course covers fundamental concepts of object oriented programming including encapsulation, inheritance, polymorphism, abstract classes, interfaces, exception handling, and event-driven programming using Java. Students are expected to complete 4 quizzes and assignments throughout the semester. The 30 lectures will cover topics ranging from basic Java syntax to advanced concepts like generics, collections, and multithreading.
This document provides information about a class on Object Oriented Programming (OOP) with C++ taught by Venkatadri.M, an Assistant Professor at the University of Petroleum and Energy Studies in Dehradun, India. The class covers the evolution of OOP, the history of C++, organizing data and functions in OOP, features of object oriented languages, and polymorphism. The instructor uses diagrams, animations and PowerPoint presentations to teach the concepts and address frequently asked questions from students.
The document discusses the history and key concepts of C++, including its creation by Bjarne Stroustrup, the influences on its development, and its combination of efficiency from C with ease of use from object-oriented programming. It explains the three main traits of object-oriented programming - encapsulation, polymorphism, and inheritance - and provides examples of each concept. The document also provides guidance for new C++ programmers on using header files, the main function, and input/output statements in their first C++ program.
This document provides an overview of object-oriented programming (OOP) including:
- The history and key concepts of OOP like classes, objects, inheritance, polymorphism, and encapsulation.
- Popular OOP languages like C++, Java, and Python.
- Differences between procedural and OOP like top-down design and modularity.
This document discusses advance object-oriented programming concepts. It covers procedural programming vs object-oriented programming, features of OOP like classes, objects, inheritance and polymorphism. It also discusses OOP design principles like single responsibility, open-closed, Liskov substitution, dependency inversion and interface segregation principles. Examples are provided to explain concepts like inheritance, polymorphism, abstraction and interfaces. The document provides a comprehensive overview of key OOP concepts and design principles.
Std 12 computer chapter 6 object oriented concepts (part 1) by Nuzhat Memon
Introduction to class and object
Procedural (Structural) programming language
Object Oriented programming language
Two ways of programming language (POP and OOP)
four specific object properties
4 pillars of OOPs
Encapsulation in Java
Abstraction in Java
Messaging in Java
Polymorphism in Java
The document discusses object-oriented programming concepts including classes, objects, encapsulation, inheritance, polymorphism, and design patterns. It defines each concept and provides examples to illustrate how they are used in object-oriented programming and modeling. Object-oriented programming is based on representing real-world entities like cars and people as objects that have states, behaviors, and can communicate with each other through messages.
C++ was created by Bjarne Stroustrup and combines elements of C and Simula67. It supports both low-level efficiency and high-level coding through object-oriented programming principles like encapsulation, polymorphism, and inheritance. C++ programs organize code around data and define types that specify which operations can be performed on that type of data.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
The document discusses key concepts in object-oriented programming (OOP) including objects, classes, encapsulation, inheritance, polymorphism, and message passing. It provides examples of a simple class named "item" that includes variables and methods. It also discusses how objects are composed of data and functions, and how classes are used to organize data and functions through principles like private/public access and data abstraction.
Defining class
Defining member functions
Static data members
Static member functions
Private data members
Public member functions
Arrays of objects
Objects as a function arguments
Constructors and destructors
Types of constructors
Handling of multiple constructors, destructors.
This document provides an overview of object-oriented programming (OOP) concepts including classes, objects, encapsulation, inheritance, polymorphism, and relationships between objects. It compares OOP to structured programming and outlines the benefits of OOP such as reusability, extensibility, and maintainability. Key OOP features like encapsulation, inheritance, polymorphism, and relationships are explained in detail. The document also introduces the Unified Modeling Language (UML) as a standard language for visualizing and modeling software systems using OOP concepts.
The document discusses object-oriented programming (OOP). It defines some key concepts in OOP including objects, classes, abstraction/encapsulation, inheritance, and polymorphism. Objects have identity, state, and behavior. Classes group similar objects and define their attributes and methods. Abstraction hides unnecessary details, while encapsulation bundles related data and functions into a class. Inheritance allows classes to inherit characteristics from other classes. Polymorphism means an object can take on multiple forms. Benefits of OOP include reusability, extensibility, understandability, and protection.
An overview of object oriented programming including the differences between OOP and the traditional structural approach, definitions of class and objects, and an easy coding example in C++. This presentation includes visual aids to make the concepts easier to understand.
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This document provides an introduction to object-oriented concepts, modeling, and system development. It discusses key topics such as:
- The benefits of object-oriented programming like modularity, information hiding, and code reuse.
- Basic concepts in OOP like objects, classes, encapsulation, inheritance, and polymorphism.
- The role of modeling in engineering by providing information about systems before they are built through mapping, reducing complexity, and being pragmatic.
- Object-oriented analysis focuses on understanding a system's functional requirements, unlike traditional function/data analysis which considers behavior and data separately.
Yevhen Kalinichenko, Senior JavaScript Developer
“Object oriented concepts in real projects”
- Abstraction. What is it and what abstraction gives us
- Inheritance. Why do we need inheritance? Composition
over inheritance.
- Encapsulation. Why it’s so important to hide
implementation. Breaking of encapsulation leads us to
maintenance hell
- Polymorphism. Working with interface but not with
concrete implementation
- Single responsibility. Why “classes” must adhere single
responsibility
- Open/Closed principle
- Related topics – cohesion, coupling, interfaces,
separation of responsibilities for each team member.
A class is the blueprint from which individual objects are created. In the real world, you'll often find many individual objects all of the same kind. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles.
The document provides an introduction to object-oriented programming concepts and Java. It discusses key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also explains the basics of Java, including its history, features like being platform independent and secure, and the structure of a Java program with main components like packages, import statements, and class definitions.
Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their use when building applications on the .NET platform.
the Concept of Object-Oriented ProgrammingAida Ramlan II
This document provides an introduction to object-oriented programming (OOP). It discusses key OOP concepts like enabling code reuse through inheritance and modifying existing code more easily. While OOP became popular in the 1980s, its origins date back to the Simula programming languages from the 1960s. OOP provides clear modular structures, makes code maintenance and modification easier, and offers a framework for code libraries. The document also defines important OOP terminology like classes, objects, encapsulation, abstraction, inheritance, polymorphism and distinguishes between abstraction and encapsulation.
This document discusses object-oriented programming (OOP) and its advantages over other programming paradigms. It begins with an introduction to programming paradigms including procedural, object-based, and object-oriented. The key concepts of OOP are then defined, including abstraction, encapsulation, modularity, inheritance, and polymorphism. Advantages of OOP include code reusability, ease of understanding and maintenance. Disadvantages include potential overgeneralization of classes and difficulty of proper planning and design.
This document provides an overview of object-oriented programming concepts including classes, objects, inheritance, abstraction, encapsulation, and polymorphism. It defines OOP as an engineering approach for building software systems based on modeling real-world entities as classes and objects that exchange messages. Key concepts are explained such as classes defining attributes and behaviors of objects, objects being instances of classes, and communication between objects occurring through messages. The four main principles of OOP - inheritance, abstraction, encapsulation, and polymorphism - are also summarized.
Program versus Software, Software Characteristics, S/W Failure rate, Evolution Pattern, Types of Software, Stakeholders in Software Engineering, Software Quality, Software Crisis, Software Engineering: A Layered Technology, Evolution of Design Techniques, Exploratory style of S/W Development
This document provides an introduction to the scripting languages AWK and GNUPlot. It discusses basics of AWK including its structure and examples of using AWK to parse text files and extract fields. It also covers basics of GNUPlot including how to generate different plot types from data files and customize plots. Finally, it provides examples of using AWK to analyze network simulation trace files generated by NS-2 to calculate packet statistics and average delay.
Std 12 computer chapter 6 object oriented concepts (part 1) by Nuzhat Memon
Introduction to class and object
Procedural (Structural) programming language
Object Oriented programming language
Two ways of programming language (POP and OOP)
four specific object properties
4 pillars of OOPs
Encapsulation in Java
Abstraction in Java
Messaging in Java
Polymorphism in Java
The document discusses object-oriented programming concepts including classes, objects, encapsulation, inheritance, polymorphism, and design patterns. It defines each concept and provides examples to illustrate how they are used in object-oriented programming and modeling. Object-oriented programming is based on representing real-world entities like cars and people as objects that have states, behaviors, and can communicate with each other through messages.
C++ was created by Bjarne Stroustrup and combines elements of C and Simula67. It supports both low-level efficiency and high-level coding through object-oriented programming principles like encapsulation, polymorphism, and inheritance. C++ programs organize code around data and define types that specify which operations can be performed on that type of data.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
The document discusses key concepts in object-oriented programming (OOP) including objects, classes, encapsulation, inheritance, polymorphism, and message passing. It provides examples of a simple class named "item" that includes variables and methods. It also discusses how objects are composed of data and functions, and how classes are used to organize data and functions through principles like private/public access and data abstraction.
Defining class
Defining member functions
Static data members
Static member functions
Private data members
Public member functions
Arrays of objects
Objects as a function arguments
Constructors and destructors
Types of constructors
Handling of multiple constructors, destructors.
This document provides an overview of object-oriented programming (OOP) concepts including classes, objects, encapsulation, inheritance, polymorphism, and relationships between objects. It compares OOP to structured programming and outlines the benefits of OOP such as reusability, extensibility, and maintainability. Key OOP features like encapsulation, inheritance, polymorphism, and relationships are explained in detail. The document also introduces the Unified Modeling Language (UML) as a standard language for visualizing and modeling software systems using OOP concepts.
The document discusses object-oriented programming (OOP). It defines some key concepts in OOP including objects, classes, abstraction/encapsulation, inheritance, and polymorphism. Objects have identity, state, and behavior. Classes group similar objects and define their attributes and methods. Abstraction hides unnecessary details, while encapsulation bundles related data and functions into a class. Inheritance allows classes to inherit characteristics from other classes. Polymorphism means an object can take on multiple forms. Benefits of OOP include reusability, extensibility, understandability, and protection.
An overview of object oriented programming including the differences between OOP and the traditional structural approach, definitions of class and objects, and an easy coding example in C++. This presentation includes visual aids to make the concepts easier to understand.
This is a presentation I did for the Cedar Rapids .NET User Group (CRineta.org). It was intended to present object oriented concepts and their application in .NET and C#.
This document provides an introduction to object-oriented concepts, modeling, and system development. It discusses key topics such as:
- The benefits of object-oriented programming like modularity, information hiding, and code reuse.
- Basic concepts in OOP like objects, classes, encapsulation, inheritance, and polymorphism.
- The role of modeling in engineering by providing information about systems before they are built through mapping, reducing complexity, and being pragmatic.
- Object-oriented analysis focuses on understanding a system's functional requirements, unlike traditional function/data analysis which considers behavior and data separately.
Yevhen Kalinichenko, Senior JavaScript Developer
“Object oriented concepts in real projects”
- Abstraction. What is it and what abstraction gives us
- Inheritance. Why do we need inheritance? Composition
over inheritance.
- Encapsulation. Why it’s so important to hide
implementation. Breaking of encapsulation leads us to
maintenance hell
- Polymorphism. Working with interface but not with
concrete implementation
- Single responsibility. Why “classes” must adhere single
responsibility
- Open/Closed principle
- Related topics – cohesion, coupling, interfaces,
separation of responsibilities for each team member.
A class is the blueprint from which individual objects are created. In the real world, you'll often find many individual objects all of the same kind. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles.
The document provides an introduction to object-oriented programming concepts and Java. It discusses key OOP concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also explains the basics of Java, including its history, features like being platform independent and secure, and the structure of a Java program with main components like packages, import statements, and class definitions.
Ever heard of the Law of Demeter? How about the Liskov Substitution Principle? This talk introduces key object-oriented laws and principles currently used in our field and provides guidance for their use when building applications on the .NET platform.
the Concept of Object-Oriented ProgrammingAida Ramlan II
This document provides an introduction to object-oriented programming (OOP). It discusses key OOP concepts like enabling code reuse through inheritance and modifying existing code more easily. While OOP became popular in the 1980s, its origins date back to the Simula programming languages from the 1960s. OOP provides clear modular structures, makes code maintenance and modification easier, and offers a framework for code libraries. The document also defines important OOP terminology like classes, objects, encapsulation, abstraction, inheritance, polymorphism and distinguishes between abstraction and encapsulation.
This document discusses object-oriented programming (OOP) and its advantages over other programming paradigms. It begins with an introduction to programming paradigms including procedural, object-based, and object-oriented. The key concepts of OOP are then defined, including abstraction, encapsulation, modularity, inheritance, and polymorphism. Advantages of OOP include code reusability, ease of understanding and maintenance. Disadvantages include potential overgeneralization of classes and difficulty of proper planning and design.
This document provides an overview of object-oriented programming concepts including classes, objects, inheritance, abstraction, encapsulation, and polymorphism. It defines OOP as an engineering approach for building software systems based on modeling real-world entities as classes and objects that exchange messages. Key concepts are explained such as classes defining attributes and behaviors of objects, objects being instances of classes, and communication between objects occurring through messages. The four main principles of OOP - inheritance, abstraction, encapsulation, and polymorphism - are also summarized.
Program versus Software, Software Characteristics, S/W Failure rate, Evolution Pattern, Types of Software, Stakeholders in Software Engineering, Software Quality, Software Crisis, Software Engineering: A Layered Technology, Evolution of Design Techniques, Exploratory style of S/W Development
This document provides an introduction to the scripting languages AWK and GNUPlot. It discusses basics of AWK including its structure and examples of using AWK to parse text files and extract fields. It also covers basics of GNUPlot including how to generate different plot types from data files and customize plots. Finally, it provides examples of using AWK to analyze network simulation trace files generated by NS-2 to calculate packet statistics and average delay.
Is your company fully engaged towards innovation?Sebastien Juras
Innovation is a popular word for management. And they are right : today in the age of information, it is mandatory for all companies to bet on innovation if they want to survive. But in order to manage a so big change, it is vital to be fully engaged to this transformation.
This document provides an overview of dependency relationships, interfaces, and basic behavior modeling in UML. It defines dependencies as relationships between model elements where one element requires the other. Dependency relationships can be further specified using keywords or stereotypes. Interfaces specify a subset of operations and attributes for classifiers to implement. Basic behavior in UML includes state machines, activities, interactions, and use cases, and behavior is always associated with an owning classifier or operation.
Introduction to database-Formal Query language and Relational calculusAjit Nayak
The document provides an introduction to relational databases and formal relational query languages. It discusses relational algebra and relational calculus as the two formal query languages that form the mathematical foundation for commercial relational query languages. Relational algebra is a procedural query language that supports operations like select, project, union, set difference, cartesian product and rename. Example queries are provided for each operation to demonstrate their usage. Relational calculus is described as a non-procedural query language with examples of queries written using its syntax.
Psychology explains the power of StorytellingSebastien Juras
Communication is a fundamental skill, but a difficult art. Storytelling is a marvelous tool to help getting yout point accross to others. Psychology explains why.
A meta story.
Introduction to database-Transaction Concurrency and RecoveryAjit Nayak
Three key points about transactions from the document:
1. A transaction is a unit of program execution that accesses and possibly updates data items in a database. It must have ACID properties - Atomicity, Consistency, Isolation, and Durability - to preserve data integrity.
2. Concurrency control schemes allow multiple transactions to run concurrently for better performance, but they must enforce transaction isolation to prevent inconsistent outcomes.
3. A concurrent schedule is considered serializable, and thus preserves isolation, if it is equivalent to some serial schedule where transactions execute one after another. This can be determined using precedence graphs.
El documento proporciona una introducción a Extreme Programming (XP), uno de los métodos ágiles más conocidos. Describe brevemente los valores fundamentales de XP, sus principales prácticas como programación en parejas y pruebas unitarias, y su énfasis en la comunicación, simplicidad y retroalimentación continua a través de iteraciones cortas. También resume el ciclo de vida típico de XP, incluidas las actividades de planeación, desarrollo e integración iterativa.
Software Engineering :UML class diagramsAjit Nayak
The document discusses UML class diagrams and their components. It defines a class diagram as representing entities with common features as rectangles divided into compartments for the class name, attributes, and operations. It provides examples of how different relationships like association, aggregation, and generalization are depicted. Key points include that association represents a "has-a" relationship, aggregation a whole-part relationship where parts can exist independently, and generalization an "is-a" relationship of inheritance.
El documento describe los conceptos clave detrás del diseño orientado a objetos, incluyendo la metáfora de la célula, objetos, roles, responsabilidades y colaboraciones. Explica que los objetos encapsulan información y servicios y colaboran entre sí para resolver problemas mayores.
UML (Unified Modeling Language) was created in the 1990s as a general-purpose modeling language for software engineering. It was developed by Grady Booch, James Rumbaugh, and Ivar Jacobson, known as "the three amigos". UML was later standardized by the Object Management Group and now includes diagrams for modeling software structure, behavior, and architecture. The OMG also established a certification program with three levels to ensure consistent understanding and proficiency with UML.
This document provides an introduction to databases and SQL. It discusses the relational model and how data is stored in tables with rows and columns. It also describes the different languages used in SQL - DDL for data definition, DML for data manipulation, and DCL for data control. Examples are provided of creating tables, inserting data, and using select statements to query and retrieve data. Group functions like COUNT, AVG, MAX etc. are also introduced. The document emphasizes the importance of transactions and using COMMIT to save changes permanently to the database.
The document discusses various Unified Modeling Language (UML) concepts including constraints, instance specifications, classifiers, features, operations, properties, and attributes. Constraints define expressions that must always be true. Instance specifications represent concrete instances and can specify attribute values incompletely. Classifiers classify instances and can be generalized. Features describe structural and behavioral characteristics, and operations specify behaviors with parameters, preconditions, and postconditions. Properties include attributes, which are contained in every object of a class. Attributes have a defined syntax including visibility, type, multiplicity, and property strings.
Este documento describe los perfiles UML y algunos perfiles estándar. Brevemente resume los perfiles UML como una extensión de UML que permite adaptarlo a dominios específicos a través de estereotipos, valores etiquetados y restricciones. Luego, menciona algunos perfiles estándar como SPEM para modelado de procesos de software, IFML para interfaces de usuario, UTP para pruebas y BPMN para procesos de negocio.
The document discusses parallel programming using MPI (Message Passing Interface). It introduces MPI as a standard for message passing between processes. It describes how to set up a basic parallel computing environment using a cluster of networked computers. It provides examples of using MPI functions to implement parallel algorithms, including point-to-point and collective communication like broadcast, gather, and scatter.
How the history of the humanity explains the difficulties of old companies are facing today. This story is the first part of the tribute to innovation trilogy.
Six things to know about your brain to become an expertSebastien Juras
Anyone can be an expert at anything. Our brain has properties to make this happen.
This story outline these properties and show you the way to follow.
It is up to you to decide which topic you want to be an expert and be fully engaged to it.
Innovation is almost impossible for older companiesSebastien Juras
The document discusses the obstacles that older companies face in innovating. It argues that innovation is essential for survival, but internal factors make it almost impossible for most companies. The main obstacles are: 1) People's skills and habits resist change. 2) Managers' interests are threatened by changes that could jeopardize their positions and privileges. 3) Shareholders demand predictable plans, but innovation requires uncertainty. 4) Financial pressures lead companies to prioritize short-term fixes over long-term innovation investments. Due to these obstacles, the document concludes that the path to innovation is impossible for most companies.
Este documento describe los principios y prácticas de administración de requisitos, incluyendo el control de cambios de requisitos, la trazabilidad de requisitos y el proceso de control de cambios. Explica que una vez aprobados, los requisitos constituyen la línea base del proyecto y deben mantenerse actualizados a medida que el proyecto avanza. También describe cómo monitorear el estado de los requisitos, gestionar cambios propuestos y realizar un análisis de impacto para comprender las implicaciones de los cambios
The document discusses the principles of object-oriented programming (OOP). It begins with an introduction to OOP and compares procedural programming with OOP. Some key concepts of OOP discussed include classes, objects, encapsulation, inheritance, and polymorphism. The document also covers benefits of OOP such as code reuse and extensibility. Examples of object-oriented languages like C++ and Java are provided.
This document provides an overview of object-oriented programming concepts including objects, classes, inheritance, encapsulation, and polymorphism. It discusses the history and objectives of OOP, defines key terms, and provides examples to illustrate concepts like how objects communicate through messages and how classes act as templates for creating objects. It also explains characteristics like encapsulation, inheritance, and polymorphism in OOP and gives examples of polymorphism in different languages.
This document provides an introduction to object-oriented system design. It defines key object-oriented concepts like objects, classes, encapsulation, inheritance, and polymorphism. It also outlines the processes of object-oriented analysis, design, and programming. Finally, it provides examples of how these concepts are implemented in C++, including how to define classes and create objects.
This document outlines the aims, design, objectives, and units of a Visual C++ programming course. The aims are to review object-oriented design and impart skills in developing VC++ applications using fundamental C++ features like classes, objects, inheritance, and encapsulation. The course is divided into units that cover developing applications using the VC++ IDE, object-oriented programming concepts, and Visual C++ basics like data types, expressions, and control structures. Key concepts like classes, objects, inheritance, polymorphism, encapsulation, and abstraction are defined. The document provides details on theory and practical lessons for each unit.
This document provides an introduction to object-oriented concepts and methodologies. It defines key OO terms like abstraction, encapsulation, polymorphism, and more. It also discusses object-oriented modeling techniques and popular object-oriented methodologies like Booch, RDD, OMT, and OOSE. The document aims to equip readers with an understanding of fundamental OO principles and how they are applied in analysis, design, and implementation of object-oriented systems.
This document discusses object-oriented programming (OOP). It begins by explaining the software crisis and issues like productivity, quality and managing schedules that OOP aims to address. It then covers procedural programming and its limitations. The key concepts of OOP like objects, classes, encapsulation, inheritance and polymorphism are explained. Popular OOP languages support these concepts to different degrees. Finally, the benefits of OOP like code reuse, modularity and managing complexity are highlighted.
C++ is an object oriented Programming language and extension of C.
Bjarne stroustrup , master of simula67 and c combined the features of both and developed a powerful language that supports object oriented programming with features of c.
Stroustrup called the new language as “ c with classes “ . in 1983 it was named as C++.
C++ is a superset of C.
Ansi – American national standards institute.
Institute founded in 1918 – goal of this institute was
To suggest
Reform
Recommend
And publish standards for data processing in usa.
Recognized council made international standard for c++
C++ is also referred as iso standard.
First draft was made on 25 January 1994.
Ansi standard attempt to ensure that c++ is portable.
The procedural language does not allow the data to flow freely around the systems
Ties to the functions that operate on it and prevents from accidental change
Oop permits to analyze a problem into number of items called objects and assembles data and functions.
Oop pays more importance of data rather than function
Programs are divided into classes and their member function
Oop follows bottom up approach
New data items and functions can be added whenever needed
Data is private and prevented from accessing external functions
Objects communicate with each other through functions
C++ is an object-oriented programming language.
Everything in C++ is associated with classes and objects, along with its attributes and methods. For example. in real life, a car is an object. The car has attributes, such as weight and color, and methods, such as drive and brake.
Attributes and methods are basically variables and functions that belongs to the class, These are often referred to as "class members".
A class is a user-defined data type that we can use in our program, and it works as an object constructor, or a "blueprint" for creating objects.
A class is a grouping of objects that have identical properties , common behavior and shared relationship
A class binds the data and its related functions together
Class identifies the nature and methods that act on the data structure and abstract data type
Group of data and code of an object can be built as user-defined data type by using class.
Objects are nothing but variables of type class.
Once a class is created , a number of objects associated with that class can be created
Syntax used to create an object is similar to create an integer variable
Class defines characteristic and action of objects
An operation required for an object or entity when coded in a class is called a method
Operations required for an object are to be defined in the class
All objects carry certain actions or operations
Each action needs an object that becomes a function in the class that defines it and is referred as a method
The document provides an introduction to object-oriented programming concepts. It discusses the key differences between procedural and object-oriented paradigms, including that OOP organizes a program around objects and data rather than procedures. It then defines important OOP concepts like classes, objects, encapsulation, inheritance, polymorphism and messaging passing. The document also provides a brief example of a simple Java program to demonstrate these concepts.
This document discusses key concepts of object-oriented programming (OOP) in C++. It defines objects, classes, methods, encapsulation, inheritance, polymorphism and other OOP pillars. It also covers data abstraction, message passing, reusability, delegation and genericity in OOP. Advantages of OOP include easy upgradability and code reuse through inheritance. OOP is widely used in simulations, databases, office software, AI systems, CAD/CAM, networking and system programming.
This document provides an introduction to object-oriented programming (OOP) using Java. It defines key OOP concepts like classes, objects, encapsulation, inheritance and polymorphism. It explains the differences between procedural and object-oriented paradigms. Popular OOP languages like Java, C++, Smalltalk are listed, with examples of how classes and objects are used to represent real-world entities like vehicles. The advantages of OOP like code reusability and modular design are also summarized.
Lesson 1 - Introduction to Object Oriented Concepts.pptxdikshaprabhugvm
Polymorphism, derived from Greek, means "many forms." In Java, it allows a single interface to represent different underlying data types. This means that a method can perform different tasks based on the object that invokes it.
This document provides an overview of Java programming basics. It discusses object-oriented programming concepts like classes, objects, inheritance, polymorphism and encapsulation. It also covers Java features like platform independence, security, simplicity and performance. Additionally, it describes Java programming fundamentals like variables, data types, operators, expressions and input/output. The document serves as an introduction to the Java language for beginners.
This document provides an introduction to object-oriented programming and Java. It discusses the basics of OOP concepts like classes, objects, encapsulation, inheritance, polymorphism and dynamic binding. It explains the benefits of OOP like modularity, code reuse and information hiding. The document also outlines some key features of the Java programming language like platform independence, security, simplicity and performance. It positions Java as a pure object-oriented language suitable for developing both standalone applications and web applets.
Object Oriented Programming using C++ Part IAjit Nayak
This document provides an introduction to object-oriented programming using C++. It outlines the topics that will be covered in the course, including fundamentals, simple programs, operators, data types, namespaces, function prototypes, references, default arguments, function overloading, and inline functions. It discusses the motivation for learning OOP and C++. The document also contains examples of simple C++ programs and explanations of concepts like function prototypes, call by value/reference, and overloading. The goal of the course is to understand object-oriented thinking and become familiar with programming in C++.
C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX
Most C++ compilers don't care what extension you give your source code, but if you don't specify otherwise, many will use .cpp by default
Most frequently used and free available compiler is GNU C/C++ compiler, otherwise you can have compilers either from HP or Solaris if you have respective Operating Systems.
The document provides an overview of Java programming basics. It discusses object-oriented programming concepts like classes, objects, inheritance, polymorphism and encapsulation. It also covers Java features like platform independence, security, simplicity. The document then describes Java programming basics like variables, data types, operators, expressions. It provides examples to explain concepts like declaring variables, assigning values, scope of variables.
1) Software testing techniques like unit testing, white-box testing, and path testing were discussed. Unit testing involves equivalence partitioning and boundary value analysis. White-box testing requires knowledge of internal structure and aims for statement, branch, and path coverage.
2) Equivalence partitioning divides inputs into classes and one test per class is sufficient. Boundary value analysis tests boundaries of classes. Path coverage requires designing test cases to execute all linearly independent paths in a program.
3) Cyclomatic complexity provides a lower bound on number of test cases needed for path coverage. It is computed based on number of edges and nodes in a control flow graph. Automated testing tools can help with regression and UI testing.
Software Engineering :Behavioral Modelling - II State diagramAjit Nayak
This document discusses software engineering principles related to behavioral modeling using state diagrams and activity diagrams. It provides examples and explanations of key concepts in behavioral modeling including states, events, conditions, transitions, activities, actions, concurrency, and swimlanes. It also discusses implementing classes based on interaction and state diagrams and provides an example state diagram for the states of a CourseSection class.
Software Engineering :Behavioral Modelling - I Sequence diagram Ajit Nayak
This document discusses software engineering principles related to domain and behavioral modeling. It defines three types of objects in domain modeling - boundary objects, entity objects, and controller objects. It also describes how behavioral models like sequence diagrams and activity diagrams can be used to model interactions between objects to produce system behaviors specified in use cases. Examples of applying these concepts to model a tic-tac-toe game and a supermarket prize scheme system are also provided.
This document provides an overview of object-oriented software design using the Unified Modeling Language (UML). It discusses key concepts in object-oriented design like classes, methods, inheritance, and relationships. It also describes UML diagrams for modeling different aspects of a system, including use case diagrams for capturing user requirements, class diagrams for modeling the structural design, and how UML was developed through the merging of earlier object-oriented modeling notations. The document aims to introduce software engineering principles and object-oriented modeling techniques using UML.
The document discusses requirements analysis and specification in software engineering. It defines what requirements are and explains the typical activities involved - requirements gathering, analysis, and specification. The importance of documenting requirements in a Software Requirements Specification (SRS) document is explained. Key sections of an SRS like stakeholders, types of requirements (functional and non-functional), and examples are covered. Special attention is given to requirements for critical systems and importance of non-functional requirements.
This document provides an overview of various software engineering process models, including:
- Waterfall model which divides the software development life cycle into sequential phases like requirements, design, implementation, testing and maintenance.
- Iterative waterfall model which allows for feedback loops between phases to catch errors earlier.
- Prototyping model which involves building prototypes to refine requirements before development.
- Incremental/evolutionary model which develops the system in modules through successive versions.
- Spiral model which represents the software process as iterative loops to progressively develop and test the product.
- Agile models like Scrum and XP which emphasize adaptive planning, evolutionary development, team collaboration and frequent delivery of working software.
This document provides an introduction and overview of NS2, a network simulator. It discusses what network simulation is and the architecture of NS2. It also provides sample NS2 input scripts written in Tcl that define nodes, links, and events. Sample output from NS2 simulations include packet trace files and NAM trace files that can be visualized. The document describes how to learn and use Tcl to write NS2 scripts, run simulations, extract data, and plot results. It also gives examples of basic Tcl commands and programming constructs like variables, control flow, arrays, and procedures.
This document provides an introduction to the network simulator NS-2 and its scripting language OTcl. It discusses basics of OTcl like classes, objects, and methods. It provides examples of creating classes and objects in OTcl. It also explains the structure of an NS-2 simulation including creating the event scheduler, topology, sending data using UDP/TCP, and tracing outputs. Suggested readings on OTcl and NS-2 tutorials are provided at the end.
This document provides an introduction to socket programming in C on Linux. Some key points:
- Sockets allow communication between processes over a network and act as an interface between applications and the network. They are represented by file descriptors.
- There are two main types of sockets - stream sockets (TCP) which provide reliable, ordered data transmission and datagram sockets (UDP) which are unreliable but do not require a connection.
- The socket API includes functions like socket(), bind(), listen(), accept(), connect(), recv(), send(), etc. to create and manage sockets and network communication.
- Data structures like sockaddr_in are used to store socket addresses containing IP and port. Byte ordering functions like
Object Oriented Analysis Design using UMLAjit Nayak
The document discusses object-oriented analysis and design (OOAD) and the Unified Modeling Language (UML). It describes the key concepts in OOAD like analysis, design, domain modeling, use cases, interaction diagrams, and class diagrams. It then explains the basic building blocks of UML including things (classes, interfaces etc.), relationships (generalization, association etc.), and diagrams (class, sequence etc.). The rest of the document provides details on modeling classes in UML including attributes, operations, responsibilities and visibility.
Operating Systems Part III-Memory ManagementAjit Nayak
The document discusses memory management techniques in operating systems. It describes how programs must be loaded into memory to execute and memory addresses are represented at different stages. It introduces the concepts of logical and physical address spaces and how they are mapped using a memory management unit. It also summarizes common memory management techniques like paging, segmentation, and swapping that allow processes to be allocated non-contiguous regions of physical memory from a pool of memory frames and backed by disk. Paging partitions both logical and physical memory into fixed-size pages and frames, using a page table to map virtual to physical addresses.
The document provides an introduction to operating systems. It defines an operating system as a program that acts as an intermediary between the user and computer hardware. The goals of an operating system are to execute user programs, make the computer system convenient to use, and efficiently use computer hardware resources. A computer system consists of hardware, an operating system, application programs, and users. The operating system controls and coordinates the use of hardware resources among applications and users.
Operating Systems Part II-Process Scheduling, Synchronisation & DeadlockAjit Nayak
This document discusses interprocess communication and CPU scheduling in operating systems. It covers two models of interprocess communication: shared memory and message passing. It also describes different CPU scheduling algorithms like first-come first-served (FCFS), shortest job first (SJF), priority scheduling, and round-robin. The key aspects of process synchronization, producer-consumer problem, and implementation of message passing are explained.
This document provides an introduction to relational database design and normalization. The goal of normalization is to avoid data redundancy and anomalies. Examples of anomalies include insertion anomalies where new data cannot be added without existing data, and deletion anomalies where deleting data also deletes other related data. The document discusses functional dependencies and normal forms to help guide the decomposition of relations into multiple normalized relations while preserving data integrity and dependencies.
This document provides an introduction to Entity-Relationship (ER) data modeling. It describes the basic concepts of entities, attributes, relationships, and keys. It explains how ER diagrams can be used to graphically represent these concepts and the structure of a database. The document also covers entity types, relationship types, participation constraints, mapping cardinalities, weak entities, and how to represent these concepts in an ER diagram.
Error detection and correction
Data link control and protocols
Point-to-Point access (PPP)
Multiple Access
Local Area Networks: Ethernet
Wireless LANS
Virtual Circuit Switching: Frame Relay and ATM
Data Communication
Networks & Internet
Protocols & Standards
Layered Tasks
Internet Model
OSI Model
Digital Transmission
Analog Transmission
Multiplexing
Transmission Media
Circuit switching and Telephone Network
Signals
Digital Transmission
Analog Transmission
Multiplexing
Transmission Media
Object Oriented Programming using C++ Part IIIAjit Nayak
The document discusses inheritance in object-oriented programming. It defines inheritance as a technique where a new subclass inherits attributes and behaviors from an existing superclass without needing to redefine them. This allows code reuse and reduces development costs. The document provides examples of single inheritance with classes like Employee and Manager, and multi-level inheritance with Student, Test, and Result classes. It also discusses polymorphism through method overriding and different types of inheritance like public, private and protected.
Computer Fundamentals & Intro to C Programming module iAjit Nayak
Introduction to Computers
Evolution of Computers
Computer Generations
Basic Computer Organization
Memory Hierarchy
I/O devices
Computer Software
Planning Computer Program
Introduction to C programming
Structure of C Programming
Datatype
Constant
Variable
Expression
Conditional Expression
Precede
WIRELESS COMMUNICATION SECURITY AND IT’S PROTECTION METHODSsamueljackson3773
In this paper, the author discusses the concerns of using various wireless communications and how to use
them safely. The author also discusses the future of the wireless industry, wireless communication
security, protection methods, and techniques that could help organizations establish a secure wireless
connection with their employees. The author also discusses other essential factors to learn and note when
manufacturing, selling, or using wireless networks and wireless communication systems.
How Binning Affects LED Performance & Consistency.pdfMina Anis
🔍 What’s Inside:
📦 What Is LED Binning?
• The process of sorting LEDs by color temperature, brightness, voltage, and CRI
• Ensures visual and performance consistency across large installations
🎨 Why It Matters:
• Inconsistent binning leads to uneven color and brightness
• Impacts brand perception, customer satisfaction, and warranty claims
📊 Key Concepts Explained:
• SDCM (Standard Deviation of Color Matching)
• Recommended bin tolerances by application (e.g., 1–3 SDCM for retail/museums)
• How to read bin codes from LED datasheets
• The difference between ANSI/NEMA standards and proprietary bin maps
🧠 Advanced Practices:
• AI-assisted bin prediction
• Color blending and dynamic calibration
• Customized binning for high-end or global projects
This study will provide the audience with an understanding of the capabilities of soft tools such as Artificial Neural Networks (ANN), Support Vector Regression (SVR), Model Trees (MT), and Multi-Gene Genetic Programming (MGGP) as a statistical downscaling tool. Many projects are underway around the world to downscale the data from Global Climate Models (GCM). The majority of the statistical tools have a lengthy downscaling pipeline to follow. To improve its accuracy, the GCM data is re-gridded according to the grid points of the observed data, standardized, and, sometimes, bias-removal is required. The current work suggests that future precipitation can be predicted by using precipitation data from the nearest four grid points as input to soft tools and observed precipitation as output. This research aims to estimate precipitation trends in the near future (2021-2050), using 5 GCMs, for Pune, in the state of Maharashtra, India. The findings indicate that each one of the soft tools can model the precipitation with excellent accuracy as compared to the traditional method of Distribution Based Scaling (DBS). The results show that ANN models appear to give the best results, followed by MT, then MGGP, and finally SVR. This work is one of a kind in that it provides insights into the changing monsoon season in Pune. The anticipated average precipitation levels depict a rise of 300–500% in January, along with increases of 200-300% in February and March, and a 100-150% increase for April and December. In contrast, rainfall appears to be decreasing by 20-30% between June and September.
11th International Conference on Data Mining (DaMi 2025)kjim477n
Welcome To DAMI 2025
Submit Your Research Articles...!!!
11th International Conference on Data Mining (DaMi 2025)
July 26 ~ 27, 2025, London, United Kingdom
Submission Deadline : June 07, 2025
Paper Submission : https://csit2025.org/submission/index.php
Contact Us : Here's where you can reach us : [email protected] or [email protected]
For more details visit : Webpage : https://csit2025.org/dami/index
May 2025: Top 10 Read Articles Advanced Information Technologyijait
International journal of advanced Information technology (IJAIT) is a bi monthly open access peer-reviewed journal, will act as a major forum for the presentation of innovative ideas, approaches, developments, and research projects in the area advanced information technology applications and services. It will also serve to facilitate the exchange of information between researchers and industry professionals to discuss the latest issues and advancement in the area of advanced IT. Core areas of advanced IT and multi-disciplinary and its applications will be covered during the conferences.
A SEW-EURODRIVE brake repair kit is needed for maintenance and repair of specific SEW-EURODRIVE brake models, like the BE series. It includes all necessary parts for preventative maintenance and repairs. This ensures proper brake functionality and extends the lifespan of the brake system
First Review PPT gfinal gyft ftu liu yrfut goSowndarya6
CyberShieldX provides end-to-end security solutions, including vulnerability assessment, penetration testing, and real-time threat detection for business websites. It ensures that organizations can identify and mitigate security risks before exploitation.
Unlike traditional security tools, CyberShieldX integrates AI models to automate vulnerability detection, minimize false positives, and enhance threat intelligence. This reduces manual effort and improves security accuracy.
Many small and medium businesses lack dedicated cybersecurity teams. CyberShieldX provides an easy-to-use platform with AI-powered insights to assist non-experts in securing their websites.
Traditional enterprise security solutions are often expensive. CyberShieldX, as a SaaS platform, offers cost-effective security solutions with flexible pricing for businesses of all sizes.
Businesses must comply with security regulations, and failure to do so can result in fines or data breaches. CyberShieldX helps organizations meet compliance requirements efficiently.
2. OOP/AKN/Part_II/2
Contents
Object Oriented Concepts
Class & Objects
Constructor & Destrctors
Operator Overloading
Friend function
Data Conversion
This pointer
Friend class
Nested Class
3. OOP/AKN/Part_II/3
How to Solve a Complex System?
The Technique of mastering complexity has
been known since ancient times “Divide and
Rule” …Dijkstra
i.e Decomposition of the Problem
Intelligent decomposition directly addresses
the inherent complexity of software by forcing
a division of systems state space
…Parnas
4. OOP/AKN/Part_II/4
Decomposition
Algorithmic/Functional Decomposition
1. Divide the system to some modules
2. Each module should denote a major step
in overall process.
Object Oriented Decomposition
1. View the world as a set of autonomous
agents that collaborate to perform some
higher level behaviour.
7. OOP/AKN/Part_II/7
Functional decomposition
Main
Problem: No. of words in a file
getWordFromFile addToWordList
getWordList sortword checkWord
Sorted Words
Word List Flag
Words Words(prev,curr)
WordWord Words
getSortedWordList countDiffWords printResult
Sorted Words
Sorted Words
Count
Count
9. OOP/AKN/Part_II/9
Which is the Right way?
Algorithmic view highlights the ordering of
events
Object Oriented view emphasizes the agents
(objects) that either cause action or to be
acted upon
Both The Philosophy are important
If the system is Very large, Complex, to be
Extended, Maintained then choose OO
approach.
10. OOP/AKN/Part_II/10
Procedural Programming
With procedural programming,
you are able to combine
sequences of calling statements
into one single place.
A procedure call is used to invoke
the procedure. After the
sequence is processed, flow of
control proceeds right after the
position where the call was made
.
Main
Program
Procedure
11. OOP/AKN/Part_II/11
Now a program can be viewed as a
sequence of procedure calls.
The main program is responsible to pass
data to the individual calls, the data is
processed by the procedures and the
resulting data is presented.
Thus, the flow of data can be illustrated as a
hierarchical graph, a tree.
Procedural Programming
14. OOP/AKN/Part_II/14
Abstraction
An Abstraction denotes the Essential
characteristics of an object that
distinguishes it from all other kinds of
objects and thus defines sharply defined
conceptual boundaries, relative to the
perspective of the viewer.
…Grady Booch
16. OOP/AKN/Part_II/16
Abstraction(contd.)
It focuses on the outside view(interface) of an
object. Therefore, it serves to separate an
objects essential behaviour from its
implementation.
It is used to reduce complexity by ignoring some
aspect of a subject that are not relevant to the
current purpose.
Example : A MAP (is not an exact picture)
Only the essential features of an area are
shown
Unimportant features are ignored.
17. OOP/AKN/Part_II/17
Abstraction(contd.)
All Abstractions have static as well as dynamic
properties.
Example: A FILE
Static : Name, Size, Content
Dynamic: the value contained in static properties.
It is dynamic because a file may grow or shrink
in size
Its name and content may change
19. OOP/AKN/Part_II/19
Encapsulation(contd.)
It is the process of compartmentalising
the elements of an abstraction that
constitute its structure and behaviour.
…Grady Booch
• In this process we keep the properties (or
structure or states) and behaviour of an
object in one place bundeled together.
• It supports information hiding
i.e. hiding all the information that is
unnecessary to the outside world.
20. OOP/AKN/Part_II/20
Encapsulation
Encapsulation helps to achieve abstraction by
hiding the implementation of behaviours
It provides explicit barriers among different
abstractions
Example: Riding a Bike
• Most of the riders are ignorant about the detail
structure of an IC Engine.
• Changing gears on your bike need not require to
know “how the gear mechanism works” just need
to know which lever to move.
21. OOP/AKN/Part_II/21
Composition defines a has-a relationship
An organized collection of components
interacting to achieve a coherent, common
behavior
The automobile has a windshield.
It deals with a single, complex system as an
organization of more numerous but simpler
systems
Composition
22. OOP/AKN/Part_II/22
Composition (examples)
A human being consists of a respiratory
system, a circulatory system, an immune
system, a nervous systems, a skeletal
system, etc
An aircraft consists of a propulsion system, a
control system, a navigation system, etc
An operating system consists of a user
interface, a file system, a network system, a
memory management system, etc
24. OOP/AKN/Part_II/24
Plant is a part of Garden(whole) (Association)
Flower is a part of Plant(whole) (Aggregation)
• Garden permits different plants to be raised over
time.
• Replacing a plant does not change the identity of a
garden.
• Removing a Garden does not necessarily destroy all
of its plants
i.e. the life time of Plant(part) and Garden (whole) are
independent.
Example
25. OOP/AKN/Part_II/25
Inheritance is the most important is-a kind
of hierarchy
Inheritance helps to share the structure and
behaviour defined in one or more classes
…Grady Booch
i.e a sub-class inherits from one or more
super-classes and subclass is dependent
upon superclass
Inheritance
27. OOP/AKN/Part_II/27
Examples (Inheritance)
Mammal is a kind of Animal
Tiger is a kind of Mammal
Cheetah is a kind of Tiger
House is a kind of Tangible Asset
Quick sort is a kind of Sorting algo
Sub class?
Super Class?
29. OOP/AKN/Part_II/29
Inheritance(contd.)
It implies a Generalization/Specialization
hierarchy
i.e subclass specializes its superclass and
superclass generalizes its subclass
Its benefits are
Extensibility,Maintainability,Reusability,
Understandability,Abstraction, and
Substitutability
30. OOP/AKN/Part_II/30
Polymorphism
It is the property that allows to exhibit
different behaviours at different situations
Different objects respond differently to a
same message
Example: message draw
Circle responds with drawing a circle
Polygon responds with drawing a polygon
…
31. OOP/AKN/Part_II/31
Dynamic Binding
(Also called as Late binding) Code
associated with a given message will be
decided at run time
Helps achieving dynamic polymorphism
34. OOP/AKN/Part_II/34
Object
What we mean?
• Humans understand the world by
viewing it as composed of
autonomous, interacting objects.
• Examples: people, animals, phone,
desks, buildings, stairs, ...
35. OOP/AKN/Part_II/35
Which is an Object?
An object may be of any of the following
A Tangible and/or Visible thing
A Table, A Tiger, A Car
Something that may be apprehended
intellectually
A Bank Account, A Complex Number
Something towards which thought or action
is directed
A Date, Time
36. OOP/AKN/Part_II/36
Virtual Objects
Objects that live in programs only, you can
not see by eyes, feel by hand, smell by
nose, and taste by tongue.
Virtual objects are the basic components for
your object-oriented programs.
37. OOP/AKN/Part_II/37
Examples of Virtual Objects
Bank Account
Keeps balance; responds to messages to deposit,
withdraw, and get balance
Set
Elements can be added, deleted, queried for
presence.
GUI Window
Ultimately responsible for keeping contents of
window. Many operations possible including open,
close, maximize, minimize, move, etc.
38. OOP/AKN/Part_II/38
Every thing are Objects?
Some objects may be tangible but have fuzzy
physical boundaries(fog, river) may not
be(sometimes) considered as objects
Difficult to distinguish my fog from your fog
But in a weather map; a fog bank over odisha is a distinctly
different object than a fog bank over Maharastra
Beauty, color, emotions(love, anger) may be
considered as properties of objects rather than
objects.
A Man(an object) loves his wife(another object)
The Cat(an object) is gray
39. OOP/AKN/Part_II/39
Defining an Object
An object has state, behavior, and identity;
the structure and behavior of similar objects
are defined in their common class; the
terms instance and object are
interchangeable
… Grady Booch
40. OOP/AKN/Part_II/40
State
The State of an object encompasses all of the
properties(static property) of the object plus
the current value (dynamic properties) of
these properties.
… Grady Booch
Example: Object :A-320:IC878 (An Air Craft)
States: Fuel = 1000 lts
Temp = 75 oC
Pressure = 200 lbs
isStart = false
…
Dynamic
PropertiesStatic
Properties
41. OOP/AKN/Part_II/41
The state
The state shows the existence of an object
When a person is dead, he has no
functions, but their DS is still there if he is
not burnt.
Also called attributes, private space,
member variables, instance variables, data
members, structure of objects etc…
42. OOP/AKN/Part_II/42
Behavior
Example: Object :A-320:IC878
start(…) : if isstart is false, fuel x lts, …
run(…) : if isStart is true, …
fly(…) : …
stop(…) : if isStart is true, …
Similarly:
fly causes decreasing in fuel and increasing
in temperature i.e change of states
43. OOP/AKN/Part_II/43
Behavior
Behavior is how an object acts and reacts,
in terms of its state changes and message
passing.
… Grady Booch
Example: Object :A-320:IC878
start, run, fly, break, stop, turn …
Behavior of an object is influenced by its
state and vice versa
44. OOP/AKN/Part_II/44
Behavior / Method
A method is an operation an object can make
to respond relevant message.
A method is associated with a class. An
object invokes a method as a reaction to
receipt of a message.
When an object has no method, it is dead!
Also called member functions, operations,
behaviors or services.
45. OOP/AKN/Part_II/45
Message
A message is a request to an object to
invoke one of its methods. A message
therefore contains
the name of the method and
the arguments of the method.
Consequently, invocation of a method is just
a reaction caused by receipt of a message.
This is only possible, if the method is actually
known to the object.
46. OOP/AKN/Part_II/46
Message
integer i; /* Define a new object */
i.setValue(1); /* Set its value to 1 */
To express the fact, that the integer object i
should set its value to 1.
The message is “Apply method setValue with
argument 1” (sent to object i). We notate the
sending of a message with the help of .(dot)
47. OOP/AKN/Part_II/47
Identity
It is that property of an object which
distinguishes it from all other objects
… Grady Booch
Two objects may have same static and
dynamic properties. But the identity
differentiates them
Example:
SSN, EmpID, Slno, …
49. OOP/AKN/Part_II/49
Class(contd.)
It defines a set of objects that share a
common structure and behaviors
… Grady Booch
A class represents only an abstraction, the
essence of an object. It doesn't exist in time
and space
Example: Class Mammal represents the
characteristics common to all mammals
To identify a particular Mammal, we say
This Mammal or that Mammal
52. OOP/AKN/Part_II/52
Interface of a Class
The interface of a class provides its outside view
and therefore, emphasizes the abstraction while
hiding its structure and the secrets of its behavior
The interface primarily consists of the declarations
of all operations applicable to its instances
But it may also include the declaration of other
classes, constants, variables and exceptions as
needed to complete the abstraction
53. OOP/AKN/Part_II/53
Interface(contd.)
The Interface of a class may be divided
into three parts
1. Public: declaration that is visible to all the
world
2. Protected: declaration that is visible to the
class itself, its subclasses, and its friends
3. Private: declaration that is visible only to
the class itself and its friends.
Also called access specifiers
57. OOP/AKN/Part_II/57
Instantiation
The mechanism of creating new objects from a
class definition is called instantiation mechanism.
Every class has such a mechanism.
Static instantiation and Dynamic instantiation.
instantiation at compile time;
instantiation at run time.
Dynamic instantiation requires a run time support for
allocation and de-allocation of memory.
58. OOP/AKN/Part_II/58
Structure vs Class in C++
A structure is simply a class whose
members are public by default.
class Time{
int hour;
int min;
int sec;
public:
Time();
void setTime(int,int,int);
void printTime(void);
};
struct Time{
int hour;
int min;
int sec;
public:
Time();
void
setTime(int,int,int);
void printTime(void)};
Public by
default
Private by
default
59. OOP/AKN/Part_II/59
Other Definitions for Objects
Anything, real, or abstract, about which
we store data and those methods
(operations) that manipulate the data.”
…Martin/Odell
An object is an instance of a class. It can be
uniquely identified by its name and it defines a
state which is represented by the values of its
attributes at a particular time.
…Peter Müller
60. OOP/AKN/Part_II/60
Constructors
Constructor is used to initialize(reserves
memory as well as set values to the data
members) an object and it is recognized by
having the same name as the class.
Constructors can be overloaded i.e. there
may be more than one constructors for the
same class with several ways of initialization
Example: Time(), Time(int),
Time(int,int,int), …
61. OOP/AKN/Part_II/61
Constructors
Every time an object is created, one constructor
is invoked
Constructors with no arguments is known as the
default constructor
Constructor can‟t have a return type
It should always be declared in public part of the
class structure. (?)
If no constructor is provided by the programmer
then compiler provides one default constructor.
ClassName(){}
62. OOP/AKN/Part_II/62
Destructors
It is a special member function named same as the
class and preceded by a ~
Example:
class Time{
… public:
~Time();
}
It is used to free the state of an object
These are called implicitly when an automatic
object goes out of scope. But if an object is
initialized using new than it has to be deleted
In very unusual situations does the user need to
call a destructor explicitly!
63. OOP/AKN/Part_II/63
Design a class ComplexNum with Attributes
real (double), img (double) and
Member Functions
Default constructor, parameterized constructor
printComplex, addComplex
Write a main function in which three objects
are created.
Two of them using parameterized constructor, one
using default constructor.
Now add first two objects using addComplex
member function and store the result in third
complex number.
Finally print all the complex numbers.
64. OOP/AKN/Part_II/64
Complex number Program
class ComplexNum{
private:
double real; double img;
public:
ComplexNum(){real=img=0.0;}
ComplexNum(double r, double i){
real = r; img = i;
}
void printComplex();
ComplexNum addComplex(ComplexNum);
}; // end of class definition
67. OOP/AKN/Part_II/67
Constant Member Functions
int func(…) const;
const is a specifier, which specifies that, this
function will not modify the states of an object.
The value of the object can‟t be changed
The keyword is written after the parentheses
Example:
class Date{
private:
int d,m,y;
public:
int day()const{return d;}
int month()const{return m;}
68. OOP/AKN/Part_II/68
Constant Member Functions(contd.)
int year()const;
int addYear(int);
};// end of class definition
int Date::year() const{return y++;}
// Error: Attempt to change value of y
int Date::year() const{return y;}
// Ok
int Date::year() {return y;}
// Error: const keyword missing
int Date::addYear(int a){return y+a;}
// Ok
69. OOP/AKN/Part_II/69
Constant Member Functions(contd.)
• A constant member function can be invoked for
both constant and non-constant objects.
• A non constant member function can be invoked
only for non-constant objects.
Example:
void f(Date &d, const Date& cd){
int i=d.year(); // Ok (one)
int k=d.addYear(1); // Ok (two)
int l=cd.addYear(1); //Error (two)
int m=cd.year(); //Ok(two)
}
70. OOP/AKN/Part_II/70
Static Class Members
Static data member is an attribute that is a
part of class, yet is not a part of an object
In other words there is exactly one copy of a
static member instead of one copy per
object
A Function that needs access to members
of a class, yet does not need to be invoked
for a particular object is called static
member function
71. OOP/AKN/Part_II/71
Example Static data member
class Sclass{
int x, y;
static int z;
. . .
};
int Sclass::z;
main() {
Sclass o, p, q;
}
o
x y
p
x y
q
x y
z
72. OOP/AKN/Part_II/72
Example: Number of objects that are live in
any point of the program
class Employee{
char* name;
static int count; // static data memb.
public:
Employee(char*);
char* getName();
static int getCount(); // static memb. func
~Employee();
};
75. OOP/AKN/Part_II/75
Example (contd)
cout<<“no of employees: “
<<e1->getCount();
cout<<“Emp1: “<<e1->getName();
cout<<“Emp2: “<<e2->getName();
delete e1;
cout<<“no of employees: “
<<e2->getCount();
delete e2;
cout<<“no of employees: “
<<Employee::getCount();
}
76. OOP/AKN/Part_II/76
Static Class Members
Static data members are accessible by both static
and/or non-static member functions
Static member functions can only access the static
class members
To access a public static class member, simply
prefix the class name and scope resolution
operator
To access a private static class member, when no
object exists take help of a static member function
otherwise non-static could be used.
78. OOP/AKN/Part_II/78
Overloading Operators
Operator Overloading allows us to overload the
existing operators s.t. they can have operands as
objects
Complex C=A+B;//A & B are complex number objs
It doesn't provide any means to create new
operators
Some operators Can‟t be overloaded
Binary operators may be overloaded either by a
non-static member function having one argument
or a non-member function having two arguments
79. OOP/AKN/Part_II/79
Example: Distance class
class Distance{
int feet;
float inches;
public:
Distance():feet(0),inches(0.0){}
Distance(int f, float i):feet(f),
inches(i){}
void showDistance(){
cout<<feet<<„‟‟<<inches<<„”‟<<endl;}
Distance addDistance(Distance);
};
85. OOP/AKN/Part_II/85
Passing two args: a non member function
class Distance{
int feet;
float inches;
public:
Distance();
Distance(int, float);
void showDistance();
};
Distance operator+(Distance, Distance);
87. OOP/AKN/Part_II/87
A solution: with a non member function
class Distance{
int feet;
float inches;
public:
Distance();
Distance(int, float);
void showDistance();
int getFeet(){return feet;}
float getInch(){return inch;}
};
Distance operator+(Distance, Distance);
88. OOP/AKN/Part_II/88
Passing Two Args
Distance operator+(Distance d1, Distance d2){
int f=d1.getFeet()+d2.getFeet();
float i=d1.getInch()+d2.getInch();
if(i>=12.0){
i-=12.0;
f++;
}
return Distance(f,i);
}
Note: In one program, there should be only one
operator overloading function for each operator.
Remember that this
function should be a
non-member!
89. OOP/AKN/Part_II/89
Friend Function
A friend of a class is a function that is not a member of
the class but is permitted to use the private and
protected members of the class
The name of the friend is not in the scope of the class
and the friend is not called with the member access
operator
It can be declared in either private or public part of a
class
A friend is explicitly declared inside the class
declaration of which it is a friend
Key word is friend
92. OOP/AKN/Part_II/92
Overloading using friend function
class Distance{
int feet;
float inches;
public:
Distance();
Distance(int, float);
void showDistance();
friend Distance operator+(Distance,
Distance);
};
93. OOP/AKN/Part_II/93
Example (contd.)
Distance operator+(Distance d1, Distance
d1){
int f = d1.feet+d2.feet;
float i = d1.inches+d2.inches;
if(i>=12.0){
i-=12.0;
f++;
}
return Distance(f,i);
}
Legal
Accessing private data
members as it is a friend
function
95. OOP/AKN/Part_II/95
Example
Matrix Vector product
class Matrix;
class Vector{
float v[4];
…
friend Vector operator* (Matrix &,Vector &);
};
class Matrix{
Vector m[4];
…
friend Vector operator*(Matrix&, Vector&);
};
96. OOP/AKN/Part_II/96
Example (Contd.)
Vector operator *(Matrix& mat, Vector& vec)
{
Vector res;
for(int i=0;i<4;i++){
res.v[i]=0;
for(int j=0;j<4;j++)
res.v[i]+=mat.m[i].v[j]*vec.v[i]; }
return res;
}
//Complete the program and execute
97. OOP/AKN/Part_II/97
Task
Overlaod + and – operators for ComplexNum
class using non-member(friend) functions.
Design the class
Define functions
Main function
98. OOP/AKN/Part_II/98
A Comparison
Access to
private part
Inside
scope of
the class
Invoked with
reference to
an object
Member
function
Yes Yes Yes
Static -
member
Yes Yes Optional
Friend
function
Yes No No
99. OOP/AKN/Part_II/99
Unary Operators
A Unary operator can be defined by either a
member function taking no arguments or a
non-member function taking one argument
Example
class X{
operator ++(); //prefix
operator ++(int); //postfix
}
100. OOP/AKN/Part_II/100
Example (contd.)
The int argument is simply a dummy
argument. It is used to distinguish between a
prefix and postfix application
Example
void operator ++(int){//postfix
feet++;
}
void operator ++(){//prefix
++feet;
}
d1++; d1.showDistance( );
++d2; d2.showDistance( );
101. OOP/AKN/Part_II/101
Mixed mode overloading
How to execute when two operands are of
different type?
Complex c,c1;
double d;
c+=c1; c+=d; c=d+c1; c=c1+d;
Complex operator +=(Complex a){
re+=a.re;
im+=a.im;
return *this;
}
Member
function
106. OOP/AKN/Part_II/106
Operator overloading
istream& operator>>(istream& in,
Complex &c){
in>>c.re>>c.img;
return in;
}
These functions must be non members as
the objects of class Complex appears in
each case as the right operand and the
function can not be a part of class ostream
and istream
107. OOP/AKN/Part_II/107
Data Conversion
„=„ is a special operator with complex properties.
When both sides are of equal type, the compiler
does not need any special instructions to operate.
If they are different ?
Conversion between Basic Types:
(int)=(float); //allowed
Each such conversion has its own routine, built
into the compiler. This is called an implicit
conversion(casting).
108. OOP/AKN/Part_II/108
Data Conversion (contd.)
Sometimes we need explicit casting like
float ..= float(int ..)
This conversion also use the built-in routines
available with the compiler.
User Defined to Basic Types
float ..=float(Distance);
float f = d1;
Operator float(){
float ft=inches/12;
ft+=float(feet);
return ft;}
109. OOP/AKN/Part_II/109
Data Conversion(contd.)
Basic to User-defined type
Distance d1=2.35;
Distance(float f){
feet=int(f);
inches=12*(f-feet);
}
User-defined to User-defined type
objA=objB;//both are objects of
different classes
111. OOP/AKN/Part_II/111
Data Conversion(contd.)
operator Rect(){
double x=radius*cos(angle);
double y=radius*sin(angle);
return Rect(x,y);
} //inside class declaration
}; //class ends here
main(){
Rect rec; Polar pol(10.0,0.785398);
rec=pol;
pol.display(); rec.display();}
112. OOP/AKN/Part_II/112
Pitfalls/Guidelines of Data Conversion
Use Similar meanings
Use overload operators to perform similar
operations as in basic types
Use Similar Syntax
Don‟t try to create new operators also don‟t design
binary operators for unary action and vice versa
Show Restraint
Don‟t overload operators if not required frequently.
Also Limit the overloaded operators for a class to
manage complexity
113. OOP/AKN/Part_II/113
Pitfalls/Guidelines of Data Conversion
Avoid Ambiguity
Don‟t try to overload the same operator in many
different ways in a same program. This may be a
confusion for the compiler.
Not All operators can be overloaded.
*(pointer), .(access op), :: (scope),
?: (ternary), and sizeof()
114. OOP/AKN/Part_II/114
Copying Objects
class Table{
char *name;
float size;
public:
Table(float s=15){
name=new char[size=s];}
};
1.Table t1;
2.Table t2=t1;
3.Table t3;
4.t3=t2;
5.Table t4(t3);
Default Constructor
//constructor is called
//copy initialization
//constructor is called
//copy assignment
//copy constructor
115. OOP/AKN/Part_II/115
Copying Objects (contd.)
Line 1: default constructor is called and the
address for the memory allocated is stored in
name variable.
Line 2: It is initialized by copying. i.e memberwise
copying t2.name=t1.name;
Now both object point to same memory area.
Line 3: default constructor is called and the
address for the memory allocated is stored in
name variable.(t3.name)
Line 4: t3.name is overwritten by t2.name which is
nothing but t1.name
Line 5: . . .
116. OOP/AKN/Part_II/116
Copying Objects (contd.)
Conclusion:
1. Storage for t3 is lost to program for ever
2. All objects point to same memory area
3. Destructor will be called Four times(?)
i.e. the same memory area will be deleted four
times and the result is undefined( may be
disastrous!)
Also called as shallow copy
117. OOP/AKN/Part_II/117
Copy Constructors
Make a duplicate copy of an object of the
same class, the default make a
memberwise copy of the the object
The default Copy constructors is created by
the compiler automatically.
A local copy of the object is constructed
which may create anomalies.
Copy constructors can also be defined by
us, which can be designed meaning fully
according to the requirement.
120. OOP/AKN/Part_II/120
The “This” Pointer
Every object has access to its own address
through a pointer called „this‟
The this pointer is passed as an implicit first
argument on every non-static member
function call for an object.
The this pointer is implicitly used to refer both
the data and function members of an object
It can also be used explicitly;
Example: (*this).x=5; or this->x=5;
121. OOP/AKN/Part_II/121
Friend Classes
If a class is declared as friend to another class then
it is allowed to access all the members of that class
To declare class A as a friend of class B, place the
corresponding declaration in the definition of class
B.
Example:
class ClassOne{
...
friend ClassTwo;
};
Friendship is neither symmetric nor transitive.
ClassTwo is allowed to
access all the members of
ClassOne
122. OOP/AKN/Part_II/122
Nested Classes
Classes like blocks and namespaces can be
nested.
These are all scopes and nesting allows local
hiding of names and local allocation of
resources.
This is often the case when a class is
needed as part of the implementation of a
larger construct
124. OOP/AKN/Part_II/124
Local / Global classes
Class declared out of all scopes are called
global class.
These classes may be used to create
objects anywhere in the program.
Class declared inside a scope (function etc)
are called local class.
Objects of this class can be used inside the
specified scope only.
125. OOP/AKN/Part_II/125
A more complete example
class String{
int length;
char *ptr;
void setString(const char*);
public:
String(const char* = ““);
String(const String&);
~String();
String& operator=(const String&);
String& operator +=(const String &);
bool operator !()const;
bool operator ==(String&)const;
126. OOP/AKN/Part_II/126
Example (contd.)
bool operator <(String)const;
bool operator !=(String&)const;
bool operator >(String&)const;
bool operator <=(String&)const;
bool operator >=(String&)const;
char& operator[](int);
String operator()(int,int);
int getLength()const;
friend ostream& operator<<(ostream&, const
String&);
friend istream& operator>>(istream&,
String&);
}; //end of class def.
135. OOP/AKN/Part_II/135
Task
Design a class called LargeInt to handle integers
of large size (O(103 ) digits)
overload all arithmetic operators (+, -, *, /, %)
overload all unary (++, --, +=, . . .) operators
overload all relational operators
design copy constructor and copy assignment
Member function to test primality
Write a suitable main function to demonstrate all
above facilities
136. OOP/AKN/Part_II/136
Readings
Programming
Bjarne Stroustrup, The C++ Programming Language, PE
Lippman, Lajoie, C++ Primer, Addison-Wesley
B. Eckel, Thinking in C++, Vol I and Vol II
Deitel & Deitel, C++ How to program
Schildt, C++ The complete reference
S. Sahay, OOP with C++
E. Balagurusami, Object oriented programming with C++
Concepts
G.Booch, Object Oriented Analysis & Design
Bertand Meyer, Object Oriented Software Construction