SlideShare a Scribd company logo
BY
N.RUBA
ASST.PROF/DEPT. OF CA,
BON SECOURS COLLEGE FOR WOMEN,
THANJAVUR.
 JAVA - A general purpose, high-
level, object-oriented, cross-
platform programming language developed
by James Gosling at Sun Microsystems in
1995.
 In structured programming, a complex
program is broken into sets of smaller,
understandable tasks; but it is very hard to
maintain.
 Introduction to oop
◦ A procedure is defined as a collection of
instruction executed in sequential order.
 Oops concept was introduced by Xerox
Corporation in early 1970s.
 The first object oriented language was
Smalltalk.
 Oops languages: C++,Java and Eiffel.
 Objects and Classes are building blocks of
OOP.
 Object is a Programming entity in OOP.
◦ It has data components representing the present
state of the object as well as functions also called
methods.
 Object contains
◦ Attributes- data associated with the object
◦ Methods-functions and code which operate on the
data
 Class is a model or pattern from which an
object is created.
 Class is a special module that defines an
object.
◦ The process of creating an object from a class is
called instantiation.
◦ Every object is an instance of a particular class
 There are 3 main characteristics
Encapsulation
•Abstraction via
encapsulation
•Data hiding
Inheritance
•Single
•multiple
Polymorphism
•Operator overloading
•Function overloading
Encapsulation-The concept of sealing data and methods
that operate on the data into an object(a single unit) .
 Abstraction via encapsulation
 data hiding
 Abstraction via encapsulation
 Software object is an abstrat entity in that we view it
from outside. Without concerning oueselves with
detail of how it work on the inside.
 E.g Car and its gear.
 Dividing a program into modules is called
modularity. Not having to know the internal
implementation of a module is called abstraction
 Data hiding
◦ Encapsulation provide the hiding of data
information.
◦ It prevent user from seeing the internal working of
an object.
◦ This is used to protect data, that should not be
manipulated by the user.
◦ Every class can hide some of the part, every
element (field or method) of one class can have one
of the three level of visibility.
◦ They are
 Public
 Private and
 protected
 Public elements are completely visible from
outside the class. They form the interface
with the outside world
 Private elements are visible only to methods
of the class itself.
 Protected elements are something between
public and private.
◦ (act as private elements, but they are completely
visible to inherited child classes)
 Benefits of encapsulation
◦ Improves program reliability
◦ Reduces maintenance
◦ Lends usability
◦ Facilitates information hiding
◦ Improves modularity
◦ Makes coding easier
BASE CLASS
CHILD CLASS
BASE CLASS
CHILD CLASS
 Advantages of using inheritance :
◦ Increased productivity
◦ Reduced maintenance
◦ Standardization
 The major drawback of inheritance is added overhead.
 An user must know changes in the methods of base class before using the
derived classobjects.
 Though the derived class objects may not require all the functionalities of
a base class,the derived class implements all the methods of base class.
This increases the amount ofmemory required for execution of the
program.
 Since common functionalities exist in the base class, there is an execution
overhead forderived class due to the implementation of base class
methods when compared to havingthe functionalities in a single class
itself. In the case of a chain of inheritances, the executionOverhead may
increase further.
 Allows an entity to take a variety of
representations
◦ Operator overloading
 Is the ability to use an operator on different argument
types e.g operator ‘+’ is used to add either integers or
floating point numbers.(for adding two nos and
concatenation of two strings)
 Java does not support user-defined operator
overloading.
 Function overloading
◦ -is the ability to access different implementations
of functions using the same name.
◦ E.g
 printdate(String Str) {……}
 //ans: August 3,2020
 Printdate(int dd,int mm, int yyyy) {…..}
 //ans:3,8,2020
 Two types of function overloading
◦ Early binding
 Allows us to have two functions in the same class that
have the same name with different parameters and
different datatypes passed to it.
 E.g add(int a, int b)
 add(int a, int b, float c)
 Early binding takes place during compile time.
◦ Late binding
 Late binding
◦ Allows us to have functions with same name in base
and derived classes. But the derived class function
will override the base class function.
 Base class functions draw()
 Derived function fill()
 METHOD OVERRIDING
SHAPE
DRAW( )
DRAW( ) DRAW( ) DRAW( )
 In classical procedural (or structural) programming, there are techniques to
write a code that handles some general task
 The most important techniques of that kind are functions (proceduresor sub-
routines). The large program is partitioned into functions that each perform a
specifictask.
 The main program calls these functions, which in turn may call other
functions. The majorconcern of this programming is with respect to the data.
Data are passed around from one non-member function to another and are
available everywhere throughout the large program.
 This allows the user to access the data directly, alter it from several points in
the program and inadvertently introduce mistakes. If one
programmerchanges the representation of the data in the computer's
memory by rearranging fields withina structure (record), other functions in
the program may need to be rewritten and must then beretested to account
for this change. That means the data are not well protected in
procedureoriented programming. Though local variables in a function can be
accessed within the function,they are not useful if they must be accessed by
different functions.
 In contrast, OOP safely encapsulates
collections of functions (called methods)
with the data they manipulate.
 The data can only be manipulated by its
own functions.
 This feature protects the data from rest of
the program.Though the concepts of object
oriented programming are different from
procedural oriented programming,
structured programming constructs are still
used in OOP especially in the codingof
methods.
 Code reusability
 Code modularity
 Easier maintenance
 Design stability
 Improved communication between developers
and users
 Seamless transition from design to
implementation
 Execution overhead-derived classes can be
very complex because of inheritance and
polymorphism
◦ Once a derived class is initiated all the data and
functions from the base classes are carried along
with it.some of these , or even most of it may not
be used
 Abstraction may lead to performance
degradation
 High learning curve
◦ OOP is different from traditional programming.
◦ We must develop strong base classes and
understand the functionality of class libraries
before take advantages from it.
 Difficulty in establishing base classes
◦ Good foundation must be created before derive
other classes.

More Related Content

What's hot

Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
kamal kotecha
 
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
CPD INDIA
 
Interface in java
Interface in javaInterface in java
Interface in java
PhD Research Scholar
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
Md.Al-imran Roton
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Saba Ameer
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
ParminderKundu
 
Java Presentation
Java PresentationJava Presentation
Java Presentationpm2214
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
Intelligo Technologies
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Veerabadra Badra
 
Presentation on-exception-handling
Presentation on-exception-handlingPresentation on-exception-handling
Presentation on-exception-handling
Nahian Ahmed
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 
Java program structure
Java program structureJava program structure
Java program structure
shalinikarunakaran1
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
Ajay Sharma
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Conceptsthinkphp
 
Java History
Java HistoryJava History
Java History
Prionto Abdullah
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 

What's hot (20)

Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 
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
 
Interface in java
Interface in javaInterface in java
Interface in java
 
OOP Introduction with java programming language
OOP Introduction with java programming languageOOP Introduction with java programming language
OOP Introduction with java programming language
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Features of java
Features of javaFeatures of java
Features of java
 
OOP java
OOP javaOOP java
OOP java
 
Presentation on-exception-handling
Presentation on-exception-handlingPresentation on-exception-handling
Presentation on-exception-handling
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
Java program structure
Java program structureJava program structure
Java program structure
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
Java History
Java HistoryJava History
Java History
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 

Similar to Introduction to Java -unit-1

4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
Ajay Chimmani
 
22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf
ssuser736e06
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
Shipra Swati
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
Muhammad Nawzir Khan
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
RAJASEKHARV10
 
chapter - 1.ppt
chapter - 1.pptchapter - 1.ppt
chapter - 1.ppt
SakthiVinoth78
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
citizen15
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
Praveen M Jigajinni
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
HouseMusica
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
kalyanibedekar
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
Unit v(dsc++)
Unit v(dsc++)Unit v(dsc++)
Unit v(dsc++)
Durga Devi
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
RAMALINGHAM KRISHNAMOORTHY
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
Saravanakumar viswanathan
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
Jeevan Acharya
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdf
Ann Wera
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
Praveen Chowdary
 

Similar to Introduction to Java -unit-1 (20)

4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf22601221182_RAHUL_MODAK_BCAC301.pdf
22601221182_RAHUL_MODAK_BCAC301.pdf
 
OOPS_Unit_1
OOPS_Unit_1OOPS_Unit_1
OOPS_Unit_1
 
Benefits of encapsulation
Benefits of encapsulationBenefits of encapsulation
Benefits of encapsulation
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
chapter - 1.ppt
chapter - 1.pptchapter - 1.ppt
chapter - 1.ppt
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
C++Day-1 Introduction.ppt
C++Day-1 Introduction.pptC++Day-1 Introduction.ppt
C++Day-1 Introduction.ppt
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
OOP.pptx
OOP.pptxOOP.pptx
OOP.pptx
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
 
Unit v(dsc++)
Unit v(dsc++)Unit v(dsc++)
Unit v(dsc++)
 
INTRODUCTION TO JAVA
INTRODUCTION TO JAVAINTRODUCTION TO JAVA
INTRODUCTION TO JAVA
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
Chapter1 introduction
Chapter1 introductionChapter1 introduction
Chapter1 introduction
 
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
 
A Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdfA Hand Book of Visual Basic 6.0.pdf.pdf
A Hand Book of Visual Basic 6.0.pdf.pdf
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 

More from RubaNagarajan

Computer graphics-CRT.pptx
Computer graphics-CRT.pptxComputer graphics-CRT.pptx
Computer graphics-CRT.pptx
RubaNagarajan
 
Matrix representation- CG.pptx
Matrix representation- CG.pptxMatrix representation- CG.pptx
Matrix representation- CG.pptx
RubaNagarajan
 
Personality development.pptx
Personality development.pptxPersonality development.pptx
Personality development.pptx
RubaNagarajan
 
TRANSFORMATION-CG.pptx
TRANSFORMATION-CG.pptxTRANSFORMATION-CG.pptx
TRANSFORMATION-CG.pptx
RubaNagarajan
 
dda algorithm-cg.pptx
dda algorithm-cg.pptxdda algorithm-cg.pptx
dda algorithm-cg.pptx
RubaNagarajan
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptx
RubaNagarajan
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
RubaNagarajan
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
RubaNagarajan
 
Java Programming
Java Programming Java Programming
Java Programming
RubaNagarajan
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
RubaNagarajan
 
Constructors in C++
Constructors in C++Constructors in C++
Constructors in C++
RubaNagarajan
 
Risks in cc
Risks in ccRisks in cc
Risks in cc
RubaNagarajan
 
Dreamweaver
DreamweaverDreamweaver
Dreamweaver
RubaNagarajan
 
Working principles of internet
Working principles of internetWorking principles of internet
Working principles of internet
RubaNagarajan
 
Coreldraw
CoreldrawCoreldraw
Coreldraw
RubaNagarajan
 
C programming
C programmingC programming
C programming
RubaNagarajan
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
RubaNagarajan
 
Virtualization in cloud computing
Virtualization in cloud computingVirtualization in cloud computing
Virtualization in cloud computing
RubaNagarajan
 
Cloud computing technology
Cloud computing technologyCloud computing technology
Cloud computing technology
RubaNagarajan
 

More from RubaNagarajan (19)

Computer graphics-CRT.pptx
Computer graphics-CRT.pptxComputer graphics-CRT.pptx
Computer graphics-CRT.pptx
 
Matrix representation- CG.pptx
Matrix representation- CG.pptxMatrix representation- CG.pptx
Matrix representation- CG.pptx
 
Personality development.pptx
Personality development.pptxPersonality development.pptx
Personality development.pptx
 
TRANSFORMATION-CG.pptx
TRANSFORMATION-CG.pptxTRANSFORMATION-CG.pptx
TRANSFORMATION-CG.pptx
 
dda algorithm-cg.pptx
dda algorithm-cg.pptxdda algorithm-cg.pptx
dda algorithm-cg.pptx
 
line attributes.pptx
line attributes.pptxline attributes.pptx
line attributes.pptx
 
Java files and io streams
Java files and io streamsJava files and io streams
Java files and io streams
 
Java -Exception handlingunit-iv
Java -Exception handlingunit-ivJava -Exception handlingunit-iv
Java -Exception handlingunit-iv
 
Java Programming
Java Programming Java Programming
Java Programming
 
Features of java unit 1
Features of java unit 1Features of java unit 1
Features of java unit 1
 
Constructors in C++
Constructors in C++Constructors in C++
Constructors in C++
 
Risks in cc
Risks in ccRisks in cc
Risks in cc
 
Dreamweaver
DreamweaverDreamweaver
Dreamweaver
 
Working principles of internet
Working principles of internetWorking principles of internet
Working principles of internet
 
Coreldraw
CoreldrawCoreldraw
Coreldraw
 
C programming
C programmingC programming
C programming
 
OPERATING SYSTEM
OPERATING SYSTEMOPERATING SYSTEM
OPERATING SYSTEM
 
Virtualization in cloud computing
Virtualization in cloud computingVirtualization in cloud computing
Virtualization in cloud computing
 
Cloud computing technology
Cloud computing technologyCloud computing technology
Cloud computing technology
 

Recently uploaded

How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 

Recently uploaded (20)

How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 

Introduction to Java -unit-1

  • 1. BY N.RUBA ASST.PROF/DEPT. OF CA, BON SECOURS COLLEGE FOR WOMEN, THANJAVUR.
  • 2.  JAVA - A general purpose, high- level, object-oriented, cross- platform programming language developed by James Gosling at Sun Microsystems in 1995.  In structured programming, a complex program is broken into sets of smaller, understandable tasks; but it is very hard to maintain.
  • 3.  Introduction to oop ◦ A procedure is defined as a collection of instruction executed in sequential order.  Oops concept was introduced by Xerox Corporation in early 1970s.  The first object oriented language was Smalltalk.  Oops languages: C++,Java and Eiffel.
  • 4.  Objects and Classes are building blocks of OOP.  Object is a Programming entity in OOP. ◦ It has data components representing the present state of the object as well as functions also called methods.  Object contains ◦ Attributes- data associated with the object ◦ Methods-functions and code which operate on the data
  • 5.  Class is a model or pattern from which an object is created.  Class is a special module that defines an object. ◦ The process of creating an object from a class is called instantiation. ◦ Every object is an instance of a particular class
  • 6.  There are 3 main characteristics Encapsulation •Abstraction via encapsulation •Data hiding Inheritance •Single •multiple Polymorphism •Operator overloading •Function overloading
  • 7. Encapsulation-The concept of sealing data and methods that operate on the data into an object(a single unit) .  Abstraction via encapsulation  data hiding  Abstraction via encapsulation  Software object is an abstrat entity in that we view it from outside. Without concerning oueselves with detail of how it work on the inside.  E.g Car and its gear.  Dividing a program into modules is called modularity. Not having to know the internal implementation of a module is called abstraction
  • 8.  Data hiding ◦ Encapsulation provide the hiding of data information. ◦ It prevent user from seeing the internal working of an object. ◦ This is used to protect data, that should not be manipulated by the user. ◦ Every class can hide some of the part, every element (field or method) of one class can have one of the three level of visibility. ◦ They are  Public  Private and  protected
  • 9.  Public elements are completely visible from outside the class. They form the interface with the outside world  Private elements are visible only to methods of the class itself.  Protected elements are something between public and private. ◦ (act as private elements, but they are completely visible to inherited child classes)
  • 10.  Benefits of encapsulation ◦ Improves program reliability ◦ Reduces maintenance ◦ Lends usability ◦ Facilitates information hiding ◦ Improves modularity ◦ Makes coding easier
  • 11. BASE CLASS CHILD CLASS BASE CLASS CHILD CLASS
  • 12.  Advantages of using inheritance : ◦ Increased productivity ◦ Reduced maintenance ◦ Standardization  The major drawback of inheritance is added overhead.  An user must know changes in the methods of base class before using the derived classobjects.  Though the derived class objects may not require all the functionalities of a base class,the derived class implements all the methods of base class. This increases the amount ofmemory required for execution of the program.  Since common functionalities exist in the base class, there is an execution overhead forderived class due to the implementation of base class methods when compared to havingthe functionalities in a single class itself. In the case of a chain of inheritances, the executionOverhead may increase further.
  • 13.  Allows an entity to take a variety of representations ◦ Operator overloading  Is the ability to use an operator on different argument types e.g operator ‘+’ is used to add either integers or floating point numbers.(for adding two nos and concatenation of two strings)  Java does not support user-defined operator overloading.
  • 14.  Function overloading ◦ -is the ability to access different implementations of functions using the same name. ◦ E.g  printdate(String Str) {……}  //ans: August 3,2020  Printdate(int dd,int mm, int yyyy) {…..}  //ans:3,8,2020
  • 15.  Two types of function overloading ◦ Early binding  Allows us to have two functions in the same class that have the same name with different parameters and different datatypes passed to it.  E.g add(int a, int b)  add(int a, int b, float c)  Early binding takes place during compile time. ◦ Late binding
  • 16.  Late binding ◦ Allows us to have functions with same name in base and derived classes. But the derived class function will override the base class function.  Base class functions draw()  Derived function fill()
  • 17.  METHOD OVERRIDING SHAPE DRAW( ) DRAW( ) DRAW( ) DRAW( )
  • 18.  In classical procedural (or structural) programming, there are techniques to write a code that handles some general task  The most important techniques of that kind are functions (proceduresor sub- routines). The large program is partitioned into functions that each perform a specifictask.  The main program calls these functions, which in turn may call other functions. The majorconcern of this programming is with respect to the data. Data are passed around from one non-member function to another and are available everywhere throughout the large program.  This allows the user to access the data directly, alter it from several points in the program and inadvertently introduce mistakes. If one programmerchanges the representation of the data in the computer's memory by rearranging fields withina structure (record), other functions in the program may need to be rewritten and must then beretested to account for this change. That means the data are not well protected in procedureoriented programming. Though local variables in a function can be accessed within the function,they are not useful if they must be accessed by different functions.
  • 19.  In contrast, OOP safely encapsulates collections of functions (called methods) with the data they manipulate.  The data can only be manipulated by its own functions.  This feature protects the data from rest of the program.Though the concepts of object oriented programming are different from procedural oriented programming, structured programming constructs are still used in OOP especially in the codingof methods.
  • 20.  Code reusability  Code modularity  Easier maintenance  Design stability  Improved communication between developers and users  Seamless transition from design to implementation
  • 21.  Execution overhead-derived classes can be very complex because of inheritance and polymorphism ◦ Once a derived class is initiated all the data and functions from the base classes are carried along with it.some of these , or even most of it may not be used  Abstraction may lead to performance degradation
  • 22.  High learning curve ◦ OOP is different from traditional programming. ◦ We must develop strong base classes and understand the functionality of class libraries before take advantages from it.  Difficulty in establishing base classes ◦ Good foundation must be created before derive other classes.