SlideShare a Scribd company logo
IADCS Diploma Course Object Oriented Programming U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd(MCC)
OOP? Software Development Technique Effective use of programmer productivity Way of Creating Large Scale Systems Approaching 100% solution
Basic Concepts Object Class Inheritance Polymorphism Encapsulation Data Abstraction
Object A Person, Place or Concepts Composed of Characteristics (data) and Behavior (Operation) Can operate directly on its data Interact sending message to each other
Class Structure that contains common data and function as entity for objects Each object is an instance of a class
Inheritance The mechanism that permits a class to share the attributes and operations defined in one or more classes
Inheritance(cont) Subclass The class which inherits from another class Super class The class from which another class inherits its behavior Multiple Inheritance A subclass inherits from two or more classes
Polymorphism The property that allows an operation to have different behavior on different objects
Encapsulation The process of binding data and methods together is known as encapsulation
Data Abstraction The process of identifying and grouping attributes and actions related to a particular entity as relevant to the application a hand. Advantages - It focus on the problem - It identifies the essential characteristics and  action  - It helps the eliminate unnecessary details.
Access Specifiers Public  Private Protected
Method Modifiers Static Abstract Final Native Volatile
Use of Modifiers No Yes No Volatile No No Yes Native Yes Yes Yes Final Yes No Yes Abstract Yes(nested) Yes Yes Protected Yes(nested) Yes Yes Private Yes Yes Yes Public Class Variable Method Modifier
Construction The process of bringing an object into existence is called construction A construction - Allocates memory -  Initializes attributes, if any - Enables access to attributes and methods
Constructor (cont) Explicit constructor User defined constructor in class definition Implicit constructor Default constructor which is provided by JVM
Destruction The process of deleting an objects is called destruction A destructor -  Frees allocated space - Disable access to attributes and methods
Method Overloading In the same class and same methods name But in different parameters and data types Form of compile time polymorphism
Method Overridden In the super class as well as subclass Allows general classes to specify methods that will common to its subclass Form of runtime polymorphism
Abstract class and method There is no code in abstract class and method Must be declared as abstract type Can not instantiated At least one abstract method in class
Writing Abstract class and Method abstract class GraphicObject  {  int x, y;   . . .  void moveTo(int newX, int newY)  { . . .  }  abstract void draw();  }
Interface A special kind of a class which consists of only the constants and the method prototypes Practically is Java substitute of multiple inheritance A class can implement multiple interfaces
Interface Vs Abstract Class A third party class must be rewritten to extend only from the abstract class. An interface implementation may be added to any existing third party classes Third party convenience Both instance and static constant are possible Static final constants only Constants An abstract class can provide complete code, default code An interface can’t provide any code at all Default implementation A class may extend only one abstract class A class May implement several interfaces. Multiple Inheritance Abstract Class Interface Feature
Package The group of classes and interfaces Can be used other java standard packages Need to specified class paths for it
Package and Access Control yes Yes No Yes Different package non-subclass Yes Yes No Yes Different package subclass Yes Yes No Yes Same package non-subclass Yes Yes No Yes Same package subclass Yes Yes Yes Yes Same class No modifier Protected Private Public
Example Java Package Java.lang Java.applet Java.awt Java.io Java.util Java.net Java.rmi….etc
//Constructor Example class Constructor_test{ public Constructor_test() { System.out.println("Hello "); } public Constructor_test(String txt) { System.out.println("Hello "+txt); } public static void main(String args[]) { Constructor_test obj=new Constructor_test(); Constructor_test obj2=new Constructor_test(args[0]); } }
Method Overloading class Method_overload{ public void Show(){ System.out.println("Hello Myanmar"); } public static int Show(int num){ int a=num+10; return a; } public static void main(String args[]){ Method_overload obj=new Method_overload(); obj.Show(); int num=Show(320); System.out.println(num); } }
Inheritance Example class Super{ public void Show(){ System.out.println("Hello"); } } class Sub extends Super{ public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); } }
Method overridden Example class Super{ public void Show(){ System.out.println("Hello"); } } class Sub extends Super{ public void Show(int num){ System.out.println("Hello "+num); } public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); obj.Show(20); } }
Example for Constructors //Constructor and Overloaded Constructor class Me{ public Me(){ System.out.println("Hello Constructor"); } public Me(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Me obj=new Me(); // implicit Me obj1=new Me("OverLoaded Constructor"); } }
Method and Overloaded Method //Method and Overloaded Method class Me{ public void Show(){ System.out.println("Hello Method"); } public void Show(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Me obj=new Me(); obj.Show(); obj.Show("Overloaded Method"); } }
Overridden Method class Me{ public void Show(){ System.out.println("Hello Method"); } } class Sub extends Me{ public void Show(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); obj.Show("Overloaded Method"); } }
Generation Interface //interface example  public interface MyInterface{ public void add(int x,int y); }
Implementing Interface class Demo implements MyInterface{ public void add(int x,int y){ System.out.println("  "+(x+y)); } public static void main(String args[]){ Demo obj=new Demo(); obj.add(20,30); } }
Generating Package package MyPackage; public class Compute{ public int Add(int x,int y){ return (x+y); } public int Subtract(int x,int y){ return (x-y); } public int Multiply(int x,int y){ return (x*y); } public int Divide(int x,int y){ return (x/y); } }
Applying Package import MyPackage.*; class PKDemo{ public static void main(String args[]){ Compute obj=new Compute(); int sum=obj.Add(10,20); int sub=obj.Subtract(20,10); System.out.println("the total is "+sum); System.out.println("the minus is "+sub); } }

More Related Content

What's hot (20)

Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
HoneyChintal
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
Shraddha
 
Strings in Java
Strings in Java Strings in Java
Strings in Java
Hitesh-Java
 
Java 8 Lambda Expressions
Java 8 Lambda ExpressionsJava 8 Lambda Expressions
Java 8 Lambda Expressions
Scott Leberknight
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
arvind pandey
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Nilesh Dalvi
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
Anil Kumar
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
Sangharsh agarwal
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
Ram132
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
OOPS Basics With Example
OOPS Basics With ExampleOOPS Basics With Example
OOPS Basics With Example
Thooyavan Venkatachalam
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 
Java IO
Java IOJava IO
Java IO
UTSAB NEUPANE
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
RahulAnanda1
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
Arzath Areeff
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
slire
 
Interface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementationInterface in java ,multiple inheritance in java, interface implementation
Interface in java ,multiple inheritance in java, interface implementation
HoneyChintal
 
Java And Multithreading
Java And MultithreadingJava And Multithreading
Java And Multithreading
Shraddha
 
Strings in Java
Strings in Java Strings in Java
Strings in Java
Hitesh-Java
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
ppd1961
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
arvind pandey
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Nilesh Dalvi
 
Control structure C++
Control structure C++Control structure C++
Control structure C++
Anil Kumar
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
Ram132
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
Spotle.ai
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
Nilesh Dalvi
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
RahulAnanda1
 

Similar to Object Oriented Programming with Java (20)

Introduction to OOPs second year cse.pptx
Introduction to OOPs second year cse.pptxIntroduction to OOPs second year cse.pptx
Introduction to OOPs second year cse.pptx
solemanhldr
 
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUEITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
VinishA23
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
Purvik Rana
 
JAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examplesJAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examples
Sunil Kumar Gunasekaran
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
Maryo Manjaruni
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
Abdii Rashid
 
JAVA-PPT'S.pdf
JAVA-PPT'S.pdfJAVA-PPT'S.pdf
JAVA-PPT'S.pdf
AnmolVerma363503
 
L02 Software Design
L02 Software DesignL02 Software Design
L02 Software Design
Ólafur Andri Ragnarsson
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Saiful Islam Sany
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
introduction to object oriented programming language java
introduction to object oriented programming language javaintroduction to object oriented programming language java
introduction to object oriented programming language java
RitikGarg39
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
Arun Vasanth
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
Abstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphismAbstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
MH Abid
 
Java presentation
Java presentationJava presentation
Java presentation
Akteruzzaman .
 
Unit 3
Unit 3Unit 3
Unit 3
R S S RAJU BATTULA
 
Basics of oops concept
Basics of oops conceptBasics of oops concept
Basics of oops concept
DINESH KUMAR ARIVARASAN
 
Chap11
Chap11Chap11
Chap11
Terry Yoast
 
Introduction to OOPs second year cse.pptx
Introduction to OOPs second year cse.pptxIntroduction to OOPs second year cse.pptx
Introduction to OOPs second year cse.pptx
solemanhldr
 
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUEITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
ITT 202 PRINCIPLES OF OBJECT ORIENTED TECHNIQUE
VinishA23
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
Purvik Rana
 
JAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examplesJAVA Notes - All major concepts covered with examples
JAVA Notes - All major concepts covered with examples
Sunil Kumar Gunasekaran
 
Jedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented conceptsJedi slides 2.1 object-oriented concepts
Jedi slides 2.1 object-oriented concepts
Maryo Manjaruni
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
KunalYadav65140
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
RaazIndia
 
introduction to object oriented programming language java
introduction to object oriented programming language javaintroduction to object oriented programming language java
introduction to object oriented programming language java
RitikGarg39
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
Arun Vasanth
 
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTORUNIT I 	OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
UNIT I OOP AND JAVA FUNDAMENTALS CONSTRUCTOR
mohanrajm63
 
Abstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphismAbstraction encapsulation inheritance polymorphism
Abstraction encapsulation inheritance polymorphism
PriyadharshiniG41
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
MH Abid
 
Ad

More from backdoor (20)

Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
backdoor
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
backdoor
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
backdoor
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
backdoor
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
backdoor
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
backdoor
 
Multithreading
MultithreadingMultithreading
Multithreading
backdoor
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
backdoor
 
IO and serialization
IO and serializationIO and serialization
IO and serialization
backdoor
 
Exception Handling
Exception HandlingException Handling
Exception Handling
backdoor
 
Java Intro
Java IntroJava Intro
Java Intro
backdoor
 
AWT Program output
AWT Program outputAWT Program output
AWT Program output
backdoor
 
Net Man
Net ManNet Man
Net Man
backdoor
 
Data Security
Data SecurityData Security
Data Security
backdoor
 
Ne Course Part One
Ne Course Part OneNe Course Part One
Ne Course Part One
backdoor
 
Ne Course Part Two
Ne Course Part TwoNe Course Part Two
Ne Course Part Two
backdoor
 
Net Sec
Net SecNet Sec
Net Sec
backdoor
 
Security Policy Checklist
Security Policy ChecklistSecurity Policy Checklist
Security Policy Checklist
backdoor
 
Java Database Connectivity
Java Database ConnectivityJava Database Connectivity
Java Database Connectivity
backdoor
 
Distributed Programming using RMI
 Distributed Programming using RMI Distributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
backdoor
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
backdoor
 
Client Side Programming with Applet
Client Side Programming with AppletClient Side Programming with Applet
Client Side Programming with Applet
backdoor
 
Java Network Programming
Java Network ProgrammingJava Network Programming
Java Network Programming
backdoor
 
Windows Programming with Swing
Windows Programming with SwingWindows Programming with Swing
Windows Programming with Swing
backdoor
 
Windows Programming with AWT
Windows Programming with AWTWindows Programming with AWT
Windows Programming with AWT
backdoor
 
Multithreading
MultithreadingMultithreading
Multithreading
backdoor
 
Object and Classes in Java
Object and Classes in JavaObject and Classes in Java
Object and Classes in Java
backdoor
 
IO and serialization
IO and serializationIO and serialization
IO and serialization
backdoor
 
Exception Handling
Exception HandlingException Handling
Exception Handling
backdoor
 
Java Intro
Java IntroJava Intro
Java Intro
backdoor
 
AWT Program output
AWT Program outputAWT Program output
AWT Program output
backdoor
 
Data Security
Data SecurityData Security
Data Security
backdoor
 
Ne Course Part One
Ne Course Part OneNe Course Part One
Ne Course Part One
backdoor
 
Ne Course Part Two
Ne Course Part TwoNe Course Part Two
Ne Course Part Two
backdoor
 
Security Policy Checklist
Security Policy ChecklistSecurity Policy Checklist
Security Policy Checklist
backdoor
 
Ad

Recently uploaded (20)

Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdfEdge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025TimeSeries Machine Learning - PyData London 2025
TimeSeries Machine Learning - PyData London 2025
Suyash Joshi
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Artificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdfArtificial Intelligence in the Nonprofit Boardroom.pdf
Artificial Intelligence in the Nonprofit Boardroom.pdf
OnBoard
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025Azure vs AWS  Which Cloud Platform Is Best for Your Business in 2025
Azure vs AWS Which Cloud Platform Is Best for Your Business in 2025
Infrassist Technologies Pvt. Ltd.
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdfBoosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Boosting MySQL with Vector Search -THE VECTOR SEARCH CONFERENCE 2025 .pdf
Alkin Tezuysal
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too LateKubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy SurveyTrustArc Webinar - 2025 Global Privacy Survey
TrustArc Webinar - 2025 Global Privacy Survey
TrustArc
 
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
“State-space Models vs. Transformers for Ultra-low-power Edge AI,” a Presenta...
Edge AI and Vision Alliance
 

Object Oriented Programming with Java

  • 1. IADCS Diploma Course Object Oriented Programming U Nyein Oo COO/Director(IT) Myanma Computer Co., Ltd(MCC)
  • 2. OOP? Software Development Technique Effective use of programmer productivity Way of Creating Large Scale Systems Approaching 100% solution
  • 3. Basic Concepts Object Class Inheritance Polymorphism Encapsulation Data Abstraction
  • 4. Object A Person, Place or Concepts Composed of Characteristics (data) and Behavior (Operation) Can operate directly on its data Interact sending message to each other
  • 5. Class Structure that contains common data and function as entity for objects Each object is an instance of a class
  • 6. Inheritance The mechanism that permits a class to share the attributes and operations defined in one or more classes
  • 7. Inheritance(cont) Subclass The class which inherits from another class Super class The class from which another class inherits its behavior Multiple Inheritance A subclass inherits from two or more classes
  • 8. Polymorphism The property that allows an operation to have different behavior on different objects
  • 9. Encapsulation The process of binding data and methods together is known as encapsulation
  • 10. Data Abstraction The process of identifying and grouping attributes and actions related to a particular entity as relevant to the application a hand. Advantages - It focus on the problem - It identifies the essential characteristics and action - It helps the eliminate unnecessary details.
  • 11. Access Specifiers Public Private Protected
  • 12. Method Modifiers Static Abstract Final Native Volatile
  • 13. Use of Modifiers No Yes No Volatile No No Yes Native Yes Yes Yes Final Yes No Yes Abstract Yes(nested) Yes Yes Protected Yes(nested) Yes Yes Private Yes Yes Yes Public Class Variable Method Modifier
  • 14. Construction The process of bringing an object into existence is called construction A construction - Allocates memory - Initializes attributes, if any - Enables access to attributes and methods
  • 15. Constructor (cont) Explicit constructor User defined constructor in class definition Implicit constructor Default constructor which is provided by JVM
  • 16. Destruction The process of deleting an objects is called destruction A destructor - Frees allocated space - Disable access to attributes and methods
  • 17. Method Overloading In the same class and same methods name But in different parameters and data types Form of compile time polymorphism
  • 18. Method Overridden In the super class as well as subclass Allows general classes to specify methods that will common to its subclass Form of runtime polymorphism
  • 19. Abstract class and method There is no code in abstract class and method Must be declared as abstract type Can not instantiated At least one abstract method in class
  • 20. Writing Abstract class and Method abstract class GraphicObject { int x, y; . . . void moveTo(int newX, int newY) { . . . } abstract void draw(); }
  • 21. Interface A special kind of a class which consists of only the constants and the method prototypes Practically is Java substitute of multiple inheritance A class can implement multiple interfaces
  • 22. Interface Vs Abstract Class A third party class must be rewritten to extend only from the abstract class. An interface implementation may be added to any existing third party classes Third party convenience Both instance and static constant are possible Static final constants only Constants An abstract class can provide complete code, default code An interface can’t provide any code at all Default implementation A class may extend only one abstract class A class May implement several interfaces. Multiple Inheritance Abstract Class Interface Feature
  • 23. Package The group of classes and interfaces Can be used other java standard packages Need to specified class paths for it
  • 24. Package and Access Control yes Yes No Yes Different package non-subclass Yes Yes No Yes Different package subclass Yes Yes No Yes Same package non-subclass Yes Yes No Yes Same package subclass Yes Yes Yes Yes Same class No modifier Protected Private Public
  • 25. Example Java Package Java.lang Java.applet Java.awt Java.io Java.util Java.net Java.rmi….etc
  • 26. //Constructor Example class Constructor_test{ public Constructor_test() { System.out.println("Hello "); } public Constructor_test(String txt) { System.out.println("Hello "+txt); } public static void main(String args[]) { Constructor_test obj=new Constructor_test(); Constructor_test obj2=new Constructor_test(args[0]); } }
  • 27. Method Overloading class Method_overload{ public void Show(){ System.out.println("Hello Myanmar"); } public static int Show(int num){ int a=num+10; return a; } public static void main(String args[]){ Method_overload obj=new Method_overload(); obj.Show(); int num=Show(320); System.out.println(num); } }
  • 28. Inheritance Example class Super{ public void Show(){ System.out.println("Hello"); } } class Sub extends Super{ public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); } }
  • 29. Method overridden Example class Super{ public void Show(){ System.out.println("Hello"); } } class Sub extends Super{ public void Show(int num){ System.out.println("Hello "+num); } public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); obj.Show(20); } }
  • 30. Example for Constructors //Constructor and Overloaded Constructor class Me{ public Me(){ System.out.println("Hello Constructor"); } public Me(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Me obj=new Me(); // implicit Me obj1=new Me("OverLoaded Constructor"); } }
  • 31. Method and Overloaded Method //Method and Overloaded Method class Me{ public void Show(){ System.out.println("Hello Method"); } public void Show(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Me obj=new Me(); obj.Show(); obj.Show("Overloaded Method"); } }
  • 32. Overridden Method class Me{ public void Show(){ System.out.println("Hello Method"); } } class Sub extends Me{ public void Show(String arg){ System.out.println("Hello " +arg); } public static void main(String args[]){ Sub obj=new Sub(); obj.Show(); obj.Show("Overloaded Method"); } }
  • 33. Generation Interface //interface example public interface MyInterface{ public void add(int x,int y); }
  • 34. Implementing Interface class Demo implements MyInterface{ public void add(int x,int y){ System.out.println(" "+(x+y)); } public static void main(String args[]){ Demo obj=new Demo(); obj.add(20,30); } }
  • 35. Generating Package package MyPackage; public class Compute{ public int Add(int x,int y){ return (x+y); } public int Subtract(int x,int y){ return (x-y); } public int Multiply(int x,int y){ return (x*y); } public int Divide(int x,int y){ return (x/y); } }
  • 36. Applying Package import MyPackage.*; class PKDemo{ public static void main(String args[]){ Compute obj=new Compute(); int sum=obj.Add(10,20); int sub=obj.Subtract(20,10); System.out.println("the total is "+sum); System.out.println("the minus is "+sub); } }