SlideShare a Scribd company logo
Java Session 2
Contents…
Oops Concepts

Java features
Oops Concepts
•   Class
•   Object
•   Polymorphism
•   Inheritance
•   Encapsulation
•   Abstraction
OOP
Polymorphism
Polymorphism

• Polymorphism gives us the ultimate
  flexibility in extensibility. The ability to
  define more than one function with the
  same name is called Polymorphism.

• In java, c++ there are two type of
  polymorphism:
       compile time polymorphism (overloading)
       runtime polymorphism (overriding).
Polymorphism 1
Polymorphism 2
Polymorphism 3
Polymorphism 4
Polymorphism 5
Polymorphism 6
Polymorphism 7
Overloading
• Example of Overloading

       int add(int a,int b)
       float add(float a,int b)
       float add(int a ,float b)
        void add(float a)
        int add(int a)
        void add(int a) //error conflict with
                      the method int add(int a)
OverLoading
    Class BookDetails{

       String title;
       String publisher;
       float price;
          setBook(String title){ }
         setBook(String title, String publisher){}
         setBook(String title, String publisher,float


                                               price){ }
}
(overriding).
  class BookDetails{
         String title;
 setBook(String title){ }
  }


class ScienceBook extends BookDetails{
        setBook(String title){}              //overriding
        setBook(String title, String publisher,float price)
             { } //overloading
 }
Difference Between Java & C++

• In C++,
  Method Overloading is an example of Static Polymorphism
  Method Overriding is an example of Run time Polymorphism


• In Java, Method overloading and Method overriding
  can be achieved using
  static methods , final methods,private methods are
  examples of Static Polymorphism.
  Instance method is an ex of Runtime Polymorphism.
Inheritance
• Inheritance is the property which allows a
  Child class to inherit some properties from
  its parent class.

• In Java this is achieved by using extends
  keyword.

• Only properties with access modifier public
  and protected can be accessed in child
  class.
Inheritance
Inheritance 1
Inheritance 2
Inheritance 3
Inheritance 4
Inheritance
    public class Parent
       {
         public String parentName;
         public int parentage;
         public String familyName;
         }

    public class Child extends Parent
{
          public String childName;
          public int childAge;
          public void printMyName()
          {
          System.out.println(“ My name is “+ chidName+” “ +familyName);
          } }
Inheritance is the process by which object of one class
acquires the properties of another class.
Encapsulation
• Encapsulation means that all data members
  (fields) of a class are declared private.
  Some methods may be private, too.
• The class interacts with other classes
  (called the clients of this class) only
  through the class’s constructors and public
  methods.
• Constructors and public methods of a class
  serve as the interface to class’s clients.
Encapsulation
• Encapsulation is the mechanism that binds together code
  and the data if manipulates, and keeps both safe from
  outside interference and misuse.

•    One way to think about encapsulation is as a protective
    wrapper that prevents the code and data from being
    arbitrarily accessed by other code defined outside the
    wrapper.

• Access to the code and data inside the wrapper is tightly
  controlled through a well-defined interface. Conclusion:
  The wrapping up of data and methods into a single unit
  (called class) is known as encapsulation.
Abstraction
• Abstraction refers to the act of representing
  essential features without including the
  background details.

• hiding unnecessary data from the users and
  making the application as user friendly then it is
  called as abstrcation
        ex:Any mail account the user is simply
  filling the form and he don't know ho it is
  developed.
Difference Between Object-based Programming &
         Object-Oriented Programming

• Object Based Programming languages obeys all
  the features of OOPs except inheritence.
  Ex: Java Script,VB script.
• Object Oriented Programming languages obeys
  all the features of OOPs.
  Ex: C++,Java
Buzz Words
· Simple
· Secure
· Portable
· Object-oriented
· Robust
· Multithreaded
· Architecture-neutral
· Interpreted
· High performance
· Distributed
· Dynamic
Simple
•         Java is designed to be easy for the
    professional programmer to learn and use.
Secure
• secure – programs are confined to the Java
  execution environment and can not access
  other parts of the computer.
Secure




• Security problems like eavasdropping,
  Tampering and virus threats can be
  eliminated or minimized by using java on
  internet
Portable
• If a program yields the same result on every
  machine, then that program is called portable.
  Java programs are portable. This is the result of
  java’s system independent nature.
Object-oriented
• Java is pure Object oriented programming
  languages because it is satisfying oops
  features.

• Class, object, Abstraction, Inheritance,
  polymorphism, Encapsulation.
Robust
• Robust means Strong. Java programs are
  strong and they don’t crash easily like c
  and c++.
    why? Excellent Exception handling
          Memory Management
  Class loader sub system of JVM will
 allocate necessary memory for java
 program.
  Garbage Collector de allocates the
 memory
Multithreaded
• A thread represents an individual process
  to execute a group of statements. JVM uses
  several threads to execute different blocks
  of code. Creating multiple threads is called
  Multi threaded.
Compiled and Interpreted
• Java Programs are compiled to generate
  byte code.

• This byte code can be downloaded and
  interpreted by the interpreter in JVM.
High performance
• The problem with the interpreter is slow.
  To over come this problem, along with
  interpreter java soft people have
  introduced JIT (Just In Time) compiler.
• Which enhance the speed of execution.
Distributed
• Java is designed for the distributed
  environment of the Internet. Because it
  handles TCP/IP protocols

• Java supports RMI (Remote Method
  Invocation).

• This feature enables a programmer to
  invoke methods across the network.
Dynamic
• Before the development of java, only static
  texts used to be displayed in browser.

• Dynamic loading is possible using applet
  programming. Which are dynamically
  interacting programs on internet.
Thank you…




         to be contd…

More Related Content

PPSX
Introduction to java
Ajay Sharma
 
PPTX
Inheritance in JAVA PPT
Pooja Jaiswal
 
PPTX
OOP Introduction with java programming language
Md.Al-imran Roton
 
PDF
Introduction to Java Programming
Ravi Kant Sahu
 
PPTX
virtual function
VENNILAV6
 
PDF
Function overloading ppt
Prof. Dr. K. Adisesha
 
PPTX
Important features of java
AL- AMIN
 
PPTX
C++ presentation
SudhanshuVijay3
 
Introduction to java
Ajay Sharma
 
Inheritance in JAVA PPT
Pooja Jaiswal
 
OOP Introduction with java programming language
Md.Al-imran Roton
 
Introduction to Java Programming
Ravi Kant Sahu
 
virtual function
VENNILAV6
 
Function overloading ppt
Prof. Dr. K. Adisesha
 
Important features of java
AL- AMIN
 
C++ presentation
SudhanshuVijay3
 

What's hot (20)

PPTX
Understanding java streams
Shahjahan Samoon
 
PPT
Java basic
Sonam Sharma
 
PDF
Java exception handling ppt
JavabynataraJ
 
PDF
Preprocessor
Learn By Watch
 
PPT
Method overriding
Azaz Maverick
 
PPTX
Python Tutorial Part 1
Haitham El-Ghareeb
 
PPTX
Inheritance In Java
Darpan Chelani
 
PPTX
Classes,object and methods java
Padma Kannan
 
PPT
Object Oriented Language
dheva B
 
PPT
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
PPTX
L14 exception handling
teach4uin
 
PPTX
Constructor and Destructors in C++
sandeep54552
 
PPT
The Evolution of Java
Fu Cheng
 
PPTX
Operators in java
Madishetty Prathibha
 
PPTX
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
PPT
Java buzzwords
ramesh517
 
PPTX
UNIT TESTING PPT
suhasreddy1
 
PDF
Demo on JavaFX
Knoldus Inc.
 
PPTX
This keyword in java
Hitesh Kumar
 
Understanding java streams
Shahjahan Samoon
 
Java basic
Sonam Sharma
 
Java exception handling ppt
JavabynataraJ
 
Preprocessor
Learn By Watch
 
Method overriding
Azaz Maverick
 
Python Tutorial Part 1
Haitham El-Ghareeb
 
Inheritance In Java
Darpan Chelani
 
Classes,object and methods java
Padma Kannan
 
Object Oriented Language
dheva B
 
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
L14 exception handling
teach4uin
 
Constructor and Destructors in C++
sandeep54552
 
The Evolution of Java
Fu Cheng
 
Operators in java
Madishetty Prathibha
 
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
Java buzzwords
ramesh517
 
UNIT TESTING PPT
suhasreddy1
 
Demo on JavaFX
Knoldus Inc.
 
This keyword in java
Hitesh Kumar
 
Ad

Viewers also liked (20)

KEY
Practical OOP In Java
wiradikusuma
 
PPT
Object Oriented Programming Concepts
thinkphp
 
PPTX
oops concept in java | object oriented programming in java
CPD INDIA
 
PPT
Basic concepts of object oriented programming
Sachin Sharma
 
PPT
Object Oriented Programming with Java
backdoor
 
PPT
Oops ppt
abhayjuneja
 
PPT
OOP in Java
wiradikusuma
 
PPT
Oop java
Minal Maniar
 
PPT
Object oriented programming (oop) cs304 power point slides lecture 01
Adil Kakakhel
 
ODP
OOP java
xball977
 
PPT
Object-oriented concepts
BG Java EE Course
 
PPTX
Introduction to Object Oriented Programming
Moutaz Haddara
 
PPTX
Object+oriented+programming+in+java
Ye Win
 
PPTX
01 introduction to oop and java
রাকিন রাকিন
 
PDF
Introduction to java and oop
baabtra.com - No. 1 supplier of quality freshers
 
PDF
Java OOP Programming language (Part 6) - Abstract Class & Interface
OUM SAOKOSAL
 
PPTX
Brain Computer Interface.ppt
Amal Sanjay
 
PDF
Java Basic Oops Concept
atozknowledge .com
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Core java oop
Parth Shah
 
Practical OOP In Java
wiradikusuma
 
Object Oriented Programming Concepts
thinkphp
 
oops concept in java | object oriented programming in java
CPD INDIA
 
Basic concepts of object oriented programming
Sachin Sharma
 
Object Oriented Programming with Java
backdoor
 
Oops ppt
abhayjuneja
 
OOP in Java
wiradikusuma
 
Oop java
Minal Maniar
 
Object oriented programming (oop) cs304 power point slides lecture 01
Adil Kakakhel
 
OOP java
xball977
 
Object-oriented concepts
BG Java EE Course
 
Introduction to Object Oriented Programming
Moutaz Haddara
 
Object+oriented+programming+in+java
Ye Win
 
01 introduction to oop and java
রাকিন রাকিন
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
OUM SAOKOSAL
 
Brain Computer Interface.ppt
Amal Sanjay
 
Java Basic Oops Concept
atozknowledge .com
 
Java interfaces
Raja Sekhar
 
Core java oop
Parth Shah
 
Ad

Similar to Java OOP s concepts and buzzwords (20)

PPTX
CS8392 OOP
DhanalakshmiVelusamy1
 
PPTX
oop unit1.pptx
sureshkumara29
 
PPTX
Introduction to oop and java fundamentals
AnsgarMary
 
PPTX
Introduction to OOP concepts
Ahmed Farag
 
PPT
Java_notes.ppt
tuyambazejeanclaude
 
PPTX
Module--fundamentals and operators in java1.pptx
Radhika Venkatesh
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
PPTX
U1 JAVA.pptx
madan r
 
PDF
Top 371 java fa qs useful for freshers and experienced
Gaurav Maheshwari
 
PDF
Java Faqs useful for freshers and experienced
yearninginjava
 
PPTX
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
AnujaS24
 
PPTX
Presentation2.ppt java basic core ppt .
KeshavMotivation
 
PPTX
A Case Study on Java. Java Presentation
Ayush Gupta
 
PPTX
object oriented programming unit one ppt
isiagnel2
 
PPTX
2. Introduction to Java for engineering stud
vyshukodumuri
 
PPT
Core Java interview questions-ppt
Mayank Kumar
 
PPSX
Core java lessons
vivek shah
 
PPTX
Java-Intro.pptx
VijalJain3
 
PPTX
Power Point Presentation on Core Java For the Beginers
SHAQUIBHASAN2
 
oop unit1.pptx
sureshkumara29
 
Introduction to oop and java fundamentals
AnsgarMary
 
Introduction to OOP concepts
Ahmed Farag
 
Java_notes.ppt
tuyambazejeanclaude
 
Module--fundamentals and operators in java1.pptx
Radhika Venkatesh
 
Need of object oriented programming
Amar Jukuntla
 
U1 JAVA.pptx
madan r
 
Top 371 java fa qs useful for freshers and experienced
Gaurav Maheshwari
 
Java Faqs useful for freshers and experienced
yearninginjava
 
OBJECT ORIENTED PROGRAMMING Unit2 second half.pptx
AnujaS24
 
Presentation2.ppt java basic core ppt .
KeshavMotivation
 
A Case Study on Java. Java Presentation
Ayush Gupta
 
object oriented programming unit one ppt
isiagnel2
 
2. Introduction to Java for engineering stud
vyshukodumuri
 
Core Java interview questions-ppt
Mayank Kumar
 
Core java lessons
vivek shah
 
Java-Intro.pptx
VijalJain3
 
Power Point Presentation on Core Java For the Beginers
SHAQUIBHASAN2
 

More from Raja Sekhar (7)

PPT
Exception handling
Raja Sekhar
 
PPT
Java multi threading
Raja Sekhar
 
PPT
Java packages
Raja Sekhar
 
PPT
String handling session 5
Raja Sekhar
 
PPTX
java Basic Programming Needs
Raja Sekhar
 
PPTX
Class object method constructors in java
Raja Sekhar
 
PPTX
Java Starting
Raja Sekhar
 
Exception handling
Raja Sekhar
 
Java multi threading
Raja Sekhar
 
Java packages
Raja Sekhar
 
String handling session 5
Raja Sekhar
 
java Basic Programming Needs
Raja Sekhar
 
Class object method constructors in java
Raja Sekhar
 
Java Starting
Raja Sekhar
 

Recently uploaded (20)

PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PDF
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
PDF
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
TumwineRobert
 
PPTX
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
PPTX
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
PDF
Landforms and landscapes data surprise preview
jpinnuck
 
PPTX
Understanding operators in c language.pptx
auteharshil95
 
PPTX
Strengthening open access through collaboration: building connections with OP...
Jisc
 
PDF
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PPTX
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
PPTX
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
Phylum Arthropoda: Characteristics and Classification, Entomology Lecture
Miraj Khan
 
Arihant Class 10 All in One Maths full pdf
sajal kumar
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Cardiovascular Pharmacology for pharmacy students.pptx
TumwineRobert
 
vedic maths in python:unleasing ancient wisdom with modern code
mistrymuskan14
 
ACUTE NASOPHARYNGITIS. pptx
AneetaSharma15
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
Open Quiz Monsoon Mind Game Prelims.pptx
Sourav Kr Podder
 
Landforms and landscapes data surprise preview
jpinnuck
 
Understanding operators in c language.pptx
auteharshil95
 
Strengthening open access through collaboration: building connections with OP...
Jisc
 
Electricity-Magnetic-and-Heating-Effects 4th Chapter/8th-science-curiosity.pd...
Sandeep Swamy
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
IMMUNIZATION PROGRAMME pptx
AneetaSharma15
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
Nursing Management of Patients with Disorders of Ear, Nose, and Throat (ENT) ...
RAKESH SAJJAN
 
Open Quiz Monsoon Mind Game Final Set.pptx
Sourav Kr Podder
 

Java OOP s concepts and buzzwords

  • 3. Oops Concepts • Class • Object • Polymorphism • Inheritance • Encapsulation • Abstraction
  • 4. OOP
  • 6. Polymorphism • Polymorphism gives us the ultimate flexibility in extensibility. The ability to define more than one function with the same name is called Polymorphism. • In java, c++ there are two type of polymorphism: compile time polymorphism (overloading) runtime polymorphism (overriding).
  • 14. Overloading • Example of Overloading int add(int a,int b) float add(float a,int b) float add(int a ,float b) void add(float a) int add(int a) void add(int a) //error conflict with the method int add(int a)
  • 15. OverLoading Class BookDetails{ String title; String publisher; float price; setBook(String title){ } setBook(String title, String publisher){} setBook(String title, String publisher,float price){ } }
  • 16. (overriding). class BookDetails{ String title; setBook(String title){ } } class ScienceBook extends BookDetails{ setBook(String title){} //overriding setBook(String title, String publisher,float price) { } //overloading }
  • 17. Difference Between Java & C++ • In C++, Method Overloading is an example of Static Polymorphism Method Overriding is an example of Run time Polymorphism • In Java, Method overloading and Method overriding can be achieved using static methods , final methods,private methods are examples of Static Polymorphism. Instance method is an ex of Runtime Polymorphism.
  • 18. Inheritance • Inheritance is the property which allows a Child class to inherit some properties from its parent class. • In Java this is achieved by using extends keyword. • Only properties with access modifier public and protected can be accessed in child class.
  • 24. Inheritance public class Parent { public String parentName; public int parentage; public String familyName; } public class Child extends Parent { public String childName; public int childAge; public void printMyName() { System.out.println(“ My name is “+ chidName+” “ +familyName); } }
  • 25. Inheritance is the process by which object of one class acquires the properties of another class.
  • 26. Encapsulation • Encapsulation means that all data members (fields) of a class are declared private. Some methods may be private, too. • The class interacts with other classes (called the clients of this class) only through the class’s constructors and public methods. • Constructors and public methods of a class serve as the interface to class’s clients.
  • 27. Encapsulation • Encapsulation is the mechanism that binds together code and the data if manipulates, and keeps both safe from outside interference and misuse. • One way to think about encapsulation is as a protective wrapper that prevents the code and data from being arbitrarily accessed by other code defined outside the wrapper. • Access to the code and data inside the wrapper is tightly controlled through a well-defined interface. Conclusion: The wrapping up of data and methods into a single unit (called class) is known as encapsulation.
  • 28. Abstraction • Abstraction refers to the act of representing essential features without including the background details. • hiding unnecessary data from the users and making the application as user friendly then it is called as abstrcation ex:Any mail account the user is simply filling the form and he don't know ho it is developed.
  • 29. Difference Between Object-based Programming & Object-Oriented Programming • Object Based Programming languages obeys all the features of OOPs except inheritence. Ex: Java Script,VB script. • Object Oriented Programming languages obeys all the features of OOPs. Ex: C++,Java
  • 30. Buzz Words · Simple · Secure · Portable · Object-oriented · Robust · Multithreaded · Architecture-neutral · Interpreted · High performance · Distributed · Dynamic
  • 31. Simple • Java is designed to be easy for the professional programmer to learn and use.
  • 32. Secure • secure – programs are confined to the Java execution environment and can not access other parts of the computer.
  • 33. Secure • Security problems like eavasdropping, Tampering and virus threats can be eliminated or minimized by using java on internet
  • 34. Portable • If a program yields the same result on every machine, then that program is called portable. Java programs are portable. This is the result of java’s system independent nature.
  • 35. Object-oriented • Java is pure Object oriented programming languages because it is satisfying oops features. • Class, object, Abstraction, Inheritance, polymorphism, Encapsulation.
  • 36. Robust • Robust means Strong. Java programs are strong and they don’t crash easily like c and c++. why? Excellent Exception handling Memory Management  Class loader sub system of JVM will allocate necessary memory for java program.  Garbage Collector de allocates the memory
  • 37. Multithreaded • A thread represents an individual process to execute a group of statements. JVM uses several threads to execute different blocks of code. Creating multiple threads is called Multi threaded.
  • 38. Compiled and Interpreted • Java Programs are compiled to generate byte code. • This byte code can be downloaded and interpreted by the interpreter in JVM.
  • 39. High performance • The problem with the interpreter is slow. To over come this problem, along with interpreter java soft people have introduced JIT (Just In Time) compiler. • Which enhance the speed of execution.
  • 40. Distributed • Java is designed for the distributed environment of the Internet. Because it handles TCP/IP protocols • Java supports RMI (Remote Method Invocation). • This feature enables a programmer to invoke methods across the network.
  • 41. Dynamic • Before the development of java, only static texts used to be displayed in browser. • Dynamic loading is possible using applet programming. Which are dynamically interacting programs on internet.
  • 42. Thank you… to be contd…