SlideShare une entreprise Scribd logo
1  sur  50
Télécharger pour lire hors ligne
   
OOPs – Advanced
   
OOPs – Const Dest
●
Constructor : Things to do when a new 
object is created
●
Destructor : Things to do when object's life 
ends. 
   
OOPs – Const Dest
   
OOPs – More Constructors
   
OOPs – More Constructors : 
ERRATA
   
Lets answer the TRICK Question
   
Lets do the TRICK Question
15 years back, before C++ came in,
Address(cool) = Address(coolness)
COMPILER OPTIMIZATION!
   
Lets answer the TRICK Question
●
While making a COPY of the parameter, the 
Copy­constructor of the parameter should 
be called!
●
Thus the compiler optimization was invalid.
   
OOPs – Interfaces
●
Class definition, no logic
●
Defines what functions and data (vars) 
should be present in the Class that 
IMPLEMENTS an interface.
●
   
OOPs – Interfaces
   
OOPs – Interfaces
   
OOPs – Abstract Class
●
Small extension of Interfaces
●
Instead of requiring subclass to implement 
ALL virtual functions, it also defines some 
function's body.
   
OOPs – Abstract Class
   
OOPs – Virtual keyword
OUTPUT for each?
   
OOPs – Virtual keyword
   
OOPs – Static Variables
   
OOPs – Static Variables
   
OOPs – Inline functions
   
OOPs – Friend Function
PS: Never encountered a good use for a friend function  :­/
   
OOPs – Static Var and Function
Output?
   
OOPs – Static Var and Function
   
OOPs – Namespace
   
OOPs – Namespace
   
OOPs – Namespace
   
OOPs – Namespace
   
OOPs – Shallow Copy
Output?
   
OOPs – Shallow Copy
   
OOPs – Deep Copy
Output?
   
OOPs – Deep Copy
   
Inheritance ­ advanced
●
Types of inheritance :
●
Public 
●
Private 
●
Protected
   
Inheritance ­ advanced
●
Types of inheritance :
●
Public 
●
Private 
●
Protected
   
Inheritance ­ advanced
●
Types of inheritance :
●
Public 
●
Private 
●
Protected
   
CLASS DIAGRAM
READUP : UML Elements
   
QUESTIONS
   
Q) Variables
●
What is the size of a NULL value in C++?
   
Q) Variables
●
What is the size of a NULL value in C++?
●
1 Byte
   
Q) Functions
●
Python uses which of the following?
●
Call by value
●
Call by reference
●
Both, interchangeably
●
None of the above
   
Q) Functions
●
Python uses which of the following?
●
Call by value
●
Call by reference
●
Both, interchangeably
●
None of the above : It uses Call­by­object
   
Q) C'tors and d'tors
OUTPUT?
   
Q) C'tors and d'tors
   
Q) This pointer
What is the error here?
   
Q) What are the OOPs conepts 
used here?
   
Q) Inheritance
WHAT VARIABLES ARE ACCESSIBLE
TO
Function foo() ?
   
Q) Inheritance
WHAT VARIABLES ARE ACCESSIBLE
TO
Function foo() ?
a_v1, a_v2, b_v2, b_v3, c_v2, c_v3
WHAT VARIABLES ARE ACCESSIBLE
TO
Object d?
   
Q) Inheritance
WHAT VARIABLES ARE ACCESSIBLE
TO
Function foo() ?
a_v1, a_v2, b_v2, b_v3, c_v2, c_v3
WHAT VARIABLES ARE ACCESSIBLE
TO
Object d?
a_v2, c_v3
   
Q) This pointer
What is the error here?
   
Q) Interfaces and Abs Class
●
Can you instanciate an object of an Abstract 
class?
   
Q) Interfaces and Abs Class
●
Can you instanciate an object of an Abstract 
class?
●
NO
   
Q) Interfaces and Abs Class
●
Can a function be final and virtual at the 
same time?
   
Q) Interfaces and Abs Class
●
Can you instanciate an object of an Abstract 
class?
●
NO
– Virtual functions HAVE to be over­ridden
– Final functions CANNOT be over­ridden

Contenu connexe

Tendances

Structured web programming
Structured web programmingStructured web programming
Structured web programming
ahfast
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
myuser
 

Tendances (20)

Android with kotlin course
Android with kotlin courseAndroid with kotlin course
Android with kotlin course
 
Is this Swift for Android? A short introduction to the Kotlin language
Is this Swift for Android? A short introduction to the Kotlin languageIs this Swift for Android? A short introduction to the Kotlin language
Is this Swift for Android? A short introduction to the Kotlin language
 
cpp-2013 #13 C++11
cpp-2013 #13 C++11cpp-2013 #13 C++11
cpp-2013 #13 C++11
 
Getting Started with PHP Extensions
Getting Started with PHP ExtensionsGetting Started with PHP Extensions
Getting Started with PHP Extensions
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
 
Getting started with typescript and angular 2
Getting started with typescript  and angular 2Getting started with typescript  and angular 2
Getting started with typescript and angular 2
 
Kotlin L → ∞
Kotlin L → ∞Kotlin L → ∞
Kotlin L → ∞
 
Introduction to Smalltalk
Introduction to SmalltalkIntroduction to Smalltalk
Introduction to Smalltalk
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Smalltalk, the dynamic language
Smalltalk, the dynamic languageSmalltalk, the dynamic language
Smalltalk, the dynamic language
 
C++
C++C++
C++
 
Intro to Kotlin Minia GDG DevFest 2017
Intro to Kotlin Minia GDG DevFest 2017Intro to Kotlin Minia GDG DevFest 2017
Intro to Kotlin Minia GDG DevFest 2017
 
Language portfolio
Language portfolioLanguage portfolio
Language portfolio
 
A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Ruby programming
Ruby programmingRuby programming
Ruby programming
 
Growing up new PostgreSQL developers (pgcon.org 2018)
Growing up new PostgreSQL developers (pgcon.org 2018)Growing up new PostgreSQL developers (pgcon.org 2018)
Growing up new PostgreSQL developers (pgcon.org 2018)
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Scala the-good-parts
Scala the-good-partsScala the-good-parts
Scala the-good-parts
 
Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7Typed Drupal - A great combination of Drupal 8 and PHP 7
Typed Drupal - A great combination of Drupal 8 and PHP 7
 

En vedette

Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharp
Abefo
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
Laxman Puri
 

En vedette (17)

Oops
OopsOops
Oops
 
Summarizing
SummarizingSummarizing
Summarizing
 
C sharp programming[1]
C sharp programming[1]C sharp programming[1]
C sharp programming[1]
 
OOPs concept and implementation
OOPs concept and implementationOOPs concept and implementation
OOPs concept and implementation
 
The Awesome Python Class Part-4
The Awesome Python Class Part-4The Awesome Python Class Part-4
The Awesome Python Class Part-4
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Object oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharpObject oriented-programming-in-c-sharp
Object oriented-programming-in-c-sharp
 
Python in real world.
Python in real world.Python in real world.
Python in real world.
 
C sharp part 001
C sharp part 001C sharp part 001
C sharp part 001
 
Lecture 3 __c_sharp
Lecture 3 __c_sharpLecture 3 __c_sharp
Lecture 3 __c_sharp
 
Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...Introduction to Java programming - Java tutorial for beginners to teach Java ...
Introduction to Java programming - Java tutorial for beginners to teach Java ...
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Java basic
Java basicJava basic
Java basic
 
Core java slides
Core java slidesCore java slides
Core java slides
 
Ppt of c vs c#
Ppt of c vs c#Ppt of c vs c#
Ppt of c vs c#
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 

Similaire à OOPS Advanced

Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014
soujavajug
 

Similaire à OOPS Advanced (20)

Software Craftmanship - Cours Polytech
Software Craftmanship - Cours PolytechSoftware Craftmanship - Cours Polytech
Software Craftmanship - Cours Polytech
 
Functional Programming in JavaScript & ESNext
Functional Programming in JavaScript & ESNextFunctional Programming in JavaScript & ESNext
Functional Programming in JavaScript & ESNext
 
Optimizing Apache Spark UDFs
Optimizing Apache Spark UDFsOptimizing Apache Spark UDFs
Optimizing Apache Spark UDFs
 
Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1Learning C++ - Introduction to c++ programming 1
Learning C++ - Introduction to c++ programming 1
 
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
CBDW2014- Intro to CommandBox; The ColdFusion CLI, Package Manager, and REPL ...
 
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)
 
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript BasicsIntroduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
 
Test Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEMTest Driven Development in CQ5/AEM
Test Driven Development in CQ5/AEM
 
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
 
Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014Hadoop Spark - Reuniao SouJava 12/04/2014
Hadoop Spark - Reuniao SouJava 12/04/2014
 
Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)Road to sbt 1.0: Paved with server (2015 Amsterdam)
Road to sbt 1.0: Paved with server (2015 Amsterdam)
 
Introduction to Spark ML Pipelines Workshop
Introduction to Spark ML Pipelines WorkshopIntroduction to Spark ML Pipelines Workshop
Introduction to Spark ML Pipelines Workshop
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Test Driven Development in AEM/CQ5
Test Driven Development in AEM/CQ5Test Driven Development in AEM/CQ5
Test Driven Development in AEM/CQ5
 
SPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic librarySPARKNaCl: A verified, fast cryptographic library
SPARKNaCl: A verified, fast cryptographic library
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Merged Automation Talk - Pete Carapetyan - Feb 2016
Merged Automation Talk - Pete Carapetyan - Feb 2016 Merged Automation Talk - Pete Carapetyan - Feb 2016
Merged Automation Talk - Pete Carapetyan - Feb 2016
 
Exciting JavaScript - Part II
Exciting JavaScript - Part IIExciting JavaScript - Part II
Exciting JavaScript - Part II
 
ITB2019 Real World Scenarios for Modern CFML - Nolan Erck
ITB2019 Real World Scenarios for Modern CFML - Nolan ErckITB2019 Real World Scenarios for Modern CFML - Nolan Erck
ITB2019 Real World Scenarios for Modern CFML - Nolan Erck
 
Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?Dependency Injection: Why is awesome and why should I care?
Dependency Injection: Why is awesome and why should I care?
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 

OOPS Advanced