SlideShare une entreprise Scribd logo
1  sur  40
Dr. Avadhesh Kumar
Asst. Prof, SAS, VIT-AP
Object Oriented Programming
 Object-oriented programming (OOP) is a
computer programming model that organizes
software design around data, or objects,
rather than functions and logic. An object can
be defined as a data field that has unique
attributes and behavior.
 Every class has data field(data member) and
method(function).
 A Java object is an instance of a Java class.
Each object has an identity, a behavior and a
state.
 The state of an object is stored in fields
(variables), while methods (functions) display
the object's behavior. Objects are created at
runtime from templates, which are also
known as classes.
 A class is a template or blueprint from which
objects are created. So, an object is the
instance(result) of a class.
 Originally, object-oriented programming was
used most frequently for two major types of
applications:
 Computer simulations,
which attempt to mimic real-world activities
so that their processes can be improved or so
that users can better understand how the
real-world processes operate
 Graphical user interfaces, or GUIs
(pronounced “gooeys”), which allow users to
interact with a program in a graphical
environment
 To understand object-oriented programming
it requires grasping three basic concepts:
 1. Encapsulation
 2. Inheritance
 3. Polymorphism
 A method is a self-contained block of
program code that carries out some action,
similar to a procedure (function) in a
procedural program (C program).
 It is like a function in C program but it is
associated some class.
 For example, a Dog class might have
methods for walking, eating.
 In object-oriented classes, attributes and
methods are encapsulated into objects.
 Encapsulation is the enclosure of data and
methods within an object.
 Encapsulation allows you to treat all of an
object’s methods and data as a single entity.
Just as an actual dog contains all of its
attributes and abilities, so would a program’s
Dog object.
 Encapsulation also refers to the concealment
of an object’s data and methods from outside
sources.
 Concealing data is sometimes called
information hiding.
 Encapsulation lets you hide specific object
attributes and methods from outside sources
and provides the security that keeps data and
methods safe from inadvertent(undesired)
changes.
 An important feature of object-oriented program
design is inheritance—the ability to create
classes that share the attributes and methods of
existing classes, but with more specific features.
 For example, Automobile is a class, and all
Automobile objects share many traits and
abilities. Convertible is a class that inherits from
the Automobile class; a Convertible is a
type of Automobile that has and can do
everything a “plain” Automobile does—but with
an added ability
 A final important concept in object-oriented
terminology is polymorphism.
 Literally, polymorphism means “many
forms”—it describes the feature of languages
that allows the same word or symbol to be
interpreted correctly in different situations
based on the context.
 For example, although the classes
Automobile, Sailboat, and Airplane all inherit
from Vehicle, turn and stop methods work
differently for instances of those classes.
 It is a Java standard, although not a requirement, to begin
class identifiers with an uppercaseletter and employ other
uppercase letters as needed to improve readability.
 (By contrast, method identifiers, like println(), conventionally
begin with a lowercase letter.)
 The stylethat joins words in which each word begins with an
uppercase letter is called Pascal casing, or sometimes upper
camel casing. You should follow established conventions for
Java so
 your programs will be easy for other programmers to
interpret and follow.
 To create a Scanner object and connect it to the
System.in object, you write a statement similar to
the following:
 Scanner inputDevice = new Scanner(System.in);
 A main() method executes automatically when
you run a program, but other methods do not
execute simply because you place them
within a class—they must be called.
 The method header is the first line of a
method. It contains the following:
 Optional access specifiers
 A return type
 An identifier
 Parentheses
 It is a special type of method which is used to
initialize the object.
 Every time an object is created using the
new() keyword, at least one constructor is
called.
 It calls a default constructor if there is no
constructor available in the class. In such
case, Java compiler provides a default
constructor by default.
 Constructor name must be the same as its
class name
 There are two types of constructors in Java:
 1. Default constructor (no-arg constructor)
 2. Parameterized constructor
 The access modifiers in Java specifies the
accessibility or scope of a field, method,
constructor, or class.
 We can change the access level of fields,
constructors, methods, and class by applying
the access modifier on it.
 Private: The access level of a private modifier is only
within the class. It cannot be accessed from outside
the class.
 Default: The access level of a default modifier is only
within the package. It cannot be accessed from
outside the package. If you do not specify any access
level, it will be the default.
 Protected: The access level of a protected modifier is
within the package and outside the package through
child class. If you do not make the child class, it
cannot be accessed from outside the package.
 Public: The access level of a public modifier is
everywhere. It can be accessed from within the class,
outside the class, within the package and outside the
package
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx
FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx

Contenu connexe

Similaire à FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx

Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answersKrishnaov
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview QuestionsKuntal Bhowmick
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Ayes Chinmay
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialscesarmendez78
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2Usman Mehmood
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basicsvamshimahi
 
Java chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsJava chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsMukesh Tekwani
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptxRaazIndia
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxKunalYadav65140
 
Nitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitishChaulagai
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptxmrxyz19
 
JavaScript OOPS Implimentation
JavaScript OOPS ImplimentationJavaScript OOPS Implimentation
JavaScript OOPS ImplimentationUsman Mehmood
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)Khaled Anaqwa
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010Rich Helton
 

Similaire à FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx (20)

Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
Internet and Web Technology (CLASS-15) [JAVA Basics] | NIC/NIELIT Web Technol...
 
Abap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorialsAbap object-oriented-programming-tutorials
Abap object-oriented-programming-tutorials
 
Java notes
Java notesJava notes
Java notes
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
 
Object oriented basics
Object oriented basicsObject oriented basics
Object oriented basics
 
Java chapter 3 - OOPs concepts
Java chapter 3 - OOPs conceptsJava chapter 3 - OOPs concepts
Java chapter 3 - OOPs concepts
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
 
Nitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptxNitish Chaulagai Java1.pptx
Nitish Chaulagai Java1.pptx
 
OOP in Java Presentation.pptx
OOP in Java Presentation.pptxOOP in Java Presentation.pptx
OOP in Java Presentation.pptx
 
Unit 1 Java
Unit 1 JavaUnit 1 Java
Unit 1 Java
 
Oops
OopsOops
Oops
 
JavaScript OOPS Implimentation
JavaScript OOPS ImplimentationJavaScript OOPS Implimentation
JavaScript OOPS Implimentation
 
Android Training (Java Review)
Android Training (Java Review)Android Training (Java Review)
Android Training (Java Review)
 
Java_presesntation.ppt
Java_presesntation.pptJava_presesntation.ppt
Java_presesntation.ppt
 
My c++
My c++My c++
My c++
 
Intro Java Rev010
Intro Java Rev010Intro Java Rev010
Intro Java Rev010
 
concept of oops
concept of oopsconcept of oops
concept of oops
 

Dernier

Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...only4webmaster01
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)sonalinghatmal
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineBruce Bennett
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...ssifa0344
 
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...amitlee9823
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...amitlee9823
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfKen Fuller
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Standkumarajju5765
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.GabrielaMiletti
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...amitlee9823
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)Delhi Call girls
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Kokokojalkojal131
 
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...amitlee9823
 
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 

Dernier (20)

Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 9155563397 👗 Top Class Call Girl Service Ban...
 
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night StandCall Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Kengeri Satellite Town ☎ 7737669865 🥵 Book Your One night Stand
 
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
Toxicokinetics studies.. (toxicokinetics evaluation in preclinical studies)
 
Resumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying OnlineResumes, Cover Letters, and Applying Online
Resumes, Cover Letters, and Applying Online
 
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Devanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Bommanahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
Solution Manual for First Course in Abstract Algebra A, 8th Edition by John B...
 
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men  🔝Nandyal🔝   Escorts...
➥🔝 7737669865 🔝▻ Nandyal Call-girls in Women Seeking Men 🔝Nandyal🔝 Escorts...
 
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men  🔝Tirupati🔝   Escor...
➥🔝 7737669865 🔝▻ Tirupati Call-girls in Women Seeking Men 🔝Tirupati🔝 Escor...
 
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdfreStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
reStartEvents 5:9 DC metro & Beyond V-Career Fair Employer Directory.pdf
 
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Janakpuri ☎ 9711199171 Book Your One night Stand
 
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Road Call Me 7737669865 Budget Friendly No Advance Booking
 
Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.Brand Analysis for reggaeton artist Jahzel.
Brand Analysis for reggaeton artist Jahzel.
 
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Sarjapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
Nagavara Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore Es...
 
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jayanagar Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Salarpur Sector 81 ( Noida)
 
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai KokoDubai Call Girls Kiki O525547819 Call Girls Dubai Koko
Dubai Call Girls Kiki O525547819 Call Girls Dubai Koko
 
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men  🔝Satara🔝   Escorts S...
➥🔝 7737669865 🔝▻ Satara Call-girls in Women Seeking Men 🔝Satara🔝 Escorts S...
 
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Btm Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 

FAL(2022-23)_CSE0206_ETH_AP2022232000455_Reference_Material_I_16-Aug-2022_Module_1_2.pptx

  • 1. Dr. Avadhesh Kumar Asst. Prof, SAS, VIT-AP Object Oriented Programming
  • 2.  Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic. An object can be defined as a data field that has unique attributes and behavior.  Every class has data field(data member) and method(function).
  • 3.  A Java object is an instance of a Java class. Each object has an identity, a behavior and a state.  The state of an object is stored in fields (variables), while methods (functions) display the object's behavior. Objects are created at runtime from templates, which are also known as classes.
  • 4.
  • 5.  A class is a template or blueprint from which objects are created. So, an object is the instance(result) of a class.
  • 6.
  • 7.  Originally, object-oriented programming was used most frequently for two major types of applications:  Computer simulations, which attempt to mimic real-world activities so that their processes can be improved or so that users can better understand how the real-world processes operate  Graphical user interfaces, or GUIs (pronounced “gooeys”), which allow users to interact with a program in a graphical environment
  • 8.  To understand object-oriented programming it requires grasping three basic concepts:  1. Encapsulation  2. Inheritance  3. Polymorphism
  • 9.
  • 10.
  • 11.  A method is a self-contained block of program code that carries out some action, similar to a procedure (function) in a procedural program (C program).  It is like a function in C program but it is associated some class.  For example, a Dog class might have methods for walking, eating.
  • 12.  In object-oriented classes, attributes and methods are encapsulated into objects.  Encapsulation is the enclosure of data and methods within an object.  Encapsulation allows you to treat all of an object’s methods and data as a single entity. Just as an actual dog contains all of its attributes and abilities, so would a program’s Dog object.
  • 13.  Encapsulation also refers to the concealment of an object’s data and methods from outside sources.  Concealing data is sometimes called information hiding.  Encapsulation lets you hide specific object attributes and methods from outside sources and provides the security that keeps data and methods safe from inadvertent(undesired) changes.
  • 14.  An important feature of object-oriented program design is inheritance—the ability to create classes that share the attributes and methods of existing classes, but with more specific features.  For example, Automobile is a class, and all Automobile objects share many traits and abilities. Convertible is a class that inherits from the Automobile class; a Convertible is a type of Automobile that has and can do everything a “plain” Automobile does—but with an added ability
  • 15.  A final important concept in object-oriented terminology is polymorphism.  Literally, polymorphism means “many forms”—it describes the feature of languages that allows the same word or symbol to be interpreted correctly in different situations based on the context.  For example, although the classes Automobile, Sailboat, and Airplane all inherit from Vehicle, turn and stop methods work differently for instances of those classes.
  • 16.
  • 17.  It is a Java standard, although not a requirement, to begin class identifiers with an uppercaseletter and employ other uppercase letters as needed to improve readability.  (By contrast, method identifiers, like println(), conventionally begin with a lowercase letter.)  The stylethat joins words in which each word begins with an uppercase letter is called Pascal casing, or sometimes upper camel casing. You should follow established conventions for Java so  your programs will be easy for other programmers to interpret and follow.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.  To create a Scanner object and connect it to the System.in object, you write a statement similar to the following:  Scanner inputDevice = new Scanner(System.in);
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.  A main() method executes automatically when you run a program, but other methods do not execute simply because you place them within a class—they must be called.  The method header is the first line of a method. It contains the following:  Optional access specifiers  A return type  An identifier  Parentheses
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.  It is a special type of method which is used to initialize the object.  Every time an object is created using the new() keyword, at least one constructor is called.  It calls a default constructor if there is no constructor available in the class. In such case, Java compiler provides a default constructor by default.
  • 34.  Constructor name must be the same as its class name  There are two types of constructors in Java:  1. Default constructor (no-arg constructor)  2. Parameterized constructor
  • 35.
  • 36.  The access modifiers in Java specifies the accessibility or scope of a field, method, constructor, or class.  We can change the access level of fields, constructors, methods, and class by applying the access modifier on it.
  • 37.  Private: The access level of a private modifier is only within the class. It cannot be accessed from outside the class.  Default: The access level of a default modifier is only within the package. It cannot be accessed from outside the package. If you do not specify any access level, it will be the default.  Protected: The access level of a protected modifier is within the package and outside the package through child class. If you do not make the child class, it cannot be accessed from outside the package.  Public: The access level of a public modifier is everywhere. It can be accessed from within the class, outside the class, within the package and outside the package