SlideShare ist ein Scribd-Unternehmen logo
1 von 42
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…

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
String in java
String in javaString in java
String in java
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Elements of Java Language
Elements of Java Language Elements of Java Language
Elements of Java Language
 
Package in Java
Package in JavaPackage in Java
Package in Java
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
Properties and indexers in C#
Properties and indexers in C#Properties and indexers in C#
Properties and indexers in C#
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Classes, objects in JAVA
Classes, objects in JAVAClasses, objects in JAVA
Classes, objects in JAVA
 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Threads in JAVA
Threads in JAVAThreads in JAVA
Threads in JAVA
 
Arrays in java
Arrays in javaArrays in java
Arrays in java
 
Inner classes in java
Inner classes in javaInner classes in java
Inner classes in java
 
Java
JavaJava
Java
 
Applet in java
Applet in javaApplet in java
Applet in java
 
Object Oriented Programming Concepts using Java
Object Oriented Programming Concepts using JavaObject Oriented Programming Concepts using Java
Object Oriented Programming Concepts using Java
 
Java notes
Java notesJava notes
Java notes
 
Features of java
Features of javaFeatures of java
Features of java
 

Andere mochten auch

Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Javawiradikusuma
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwordsramesh517
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaCPD INDIA
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Javabackdoor
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01Adil Kakakhel
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMoutaz Haddara
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+javaYe Win
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceOUM SAOKOSAL
 
Brain Computer Interface.ppt
Brain Computer Interface.pptBrain Computer Interface.ppt
Brain Computer Interface.pptAmal Sanjay
 

Andere mochten auch (20)

Practical OOP In Java
Practical OOP In JavaPractical OOP In Java
Practical OOP In Java
 
Java buzzwords
Java buzzwordsJava buzzwords
Java buzzwords
 
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 
Oop java
Oop javaOop java
Oop java
 
Object oriented programming (oop) cs304 power point slides lecture 01
Object oriented programming (oop)   cs304 power point slides lecture 01Object oriented programming (oop)   cs304 power point slides lecture 01
Object oriented programming (oop) cs304 power point slides lecture 01
 
OOP java
OOP javaOOP java
OOP java
 
Object-oriented concepts
Object-oriented conceptsObject-oriented concepts
Object-oriented concepts
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object+oriented+programming+in+java
Object+oriented+programming+in+javaObject+oriented+programming+in+java
Object+oriented+programming+in+java
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
 
Introduction to java and oop
Introduction to java and oopIntroduction to java and oop
Introduction to java and oop
 
Java OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & InterfaceJava OOP Programming language (Part 6) - Abstract Class & Interface
Java OOP Programming language (Part 6) - Abstract Class & Interface
 
Brain Computer Interface.ppt
Brain Computer Interface.pptBrain Computer Interface.ppt
Brain Computer Interface.ppt
 
Java Basic Oops Concept
Java Basic Oops ConceptJava Basic Oops Concept
Java Basic Oops Concept
 
Java interfaces
Java interfacesJava interfaces
Java interfaces
 
Core java oop
Core java oopCore java oop
Core java oop
 

Ähnlich wie Java OOP s concepts and buzzwords

Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentalsAnsgarMary
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP conceptsAhmed Farag
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programmingAmar Jukuntla
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptxmadan r
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedGaurav Maheshwari
 
Java Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedJava Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedyearninginjava
 
A Case Study on Java. Java Presentation
A Case Study on Java. Java Presentation A Case Study on Java. Java Presentation
A Case Study on Java. Java Presentation Ayush Gupta
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-pptMayank Kumar
 
Core java lessons
Core java lessonsCore java lessons
Core java lessonsvivek shah
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptxVijalJain3
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)smumbahelp
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for seleniumapoorvams
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptxrayanbabur
 

Ähnlich wie Java OOP s concepts and buzzwords (20)

CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Introduction to oop and java fundamentals
Introduction to oop and java fundamentalsIntroduction to oop and java fundamentals
Introduction to oop and java fundamentals
 
Introduction to OOP concepts
Introduction to OOP conceptsIntroduction to OOP concepts
Introduction to OOP concepts
 
Java_notes.ppt
Java_notes.pptJava_notes.ppt
Java_notes.ppt
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
U1 JAVA.pptx
U1 JAVA.pptxU1 JAVA.pptx
U1 JAVA.pptx
 
Top 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experiencedTop 371 java fa qs useful for freshers and experienced
Top 371 java fa qs useful for freshers and experienced
 
Java Faqs useful for freshers and experienced
Java Faqs useful for freshers and experiencedJava Faqs useful for freshers and experienced
Java Faqs useful for freshers and experienced
 
A Case Study on Java. Java Presentation
A Case Study on Java. Java Presentation A Case Study on Java. Java Presentation
A Case Study on Java. Java Presentation
 
Core Java interview questions-ppt
Core Java interview questions-pptCore Java interview questions-ppt
Core Java interview questions-ppt
 
Cse java
Cse javaCse java
Cse java
 
Core java lessons
Core java lessonsCore java lessons
Core java lessons
 
Java-Intro.pptx
Java-Intro.pptxJava-Intro.pptx
Java-Intro.pptx
 
Core_Java_Interview.pdf
Core_Java_Interview.pdfCore_Java_Interview.pdf
Core_Java_Interview.pdf
 
Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)Mcs 024 assignment solution (2020-21)
Mcs 024 assignment solution (2020-21)
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
 
Comp102 lec 3
Comp102   lec 3Comp102   lec 3
Comp102 lec 3
 
Java Basics for selenium
Java Basics for seleniumJava Basics for selenium
Java Basics for selenium
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
 

Mehr von Raja Sekhar

Exception handling
Exception handlingException handling
Exception handlingRaja Sekhar
 
Java multi threading
Java multi threadingJava multi threading
Java multi threadingRaja Sekhar
 
String handling session 5
String handling session 5String handling session 5
String handling session 5Raja Sekhar
 
java Basic Programming Needs
java Basic Programming Needsjava Basic Programming Needs
java Basic Programming NeedsRaja Sekhar
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in javaRaja Sekhar
 

Mehr von Raja Sekhar (6)

Exception handling
Exception handlingException handling
Exception handling
 
Java multi threading
Java multi threadingJava multi threading
Java multi threading
 
String handling session 5
String handling session 5String handling session 5
String handling session 5
 
java Basic Programming Needs
java Basic Programming Needsjava Basic Programming Needs
java Basic Programming Needs
 
Class object method constructors in java
Class object method constructors in javaClass object method constructors in java
Class object method constructors in java
 
Java Starting
Java StartingJava Starting
Java Starting
 

Kürzlich hochgeladen

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Kürzlich hochgeladen (20)

ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

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…