SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
1
Object Oriented
Programming-Java
OOP vs POP, Java,
Java Technologies,
Prepared by: Said H Said
The University of Dodoma
2
Procedural Oriented
Programing (POP)
 Program is divided into small parts called
functions
 Importance is not given to data but to
functions as well as sequence of actions to
be done
 Does not have any access specifies
 In POP, Data can move freely from function
to function in the system
Prepared by: Said H Said
The University of Dodoma
3
POP Cont…
 To add new data and function in POP is not
so easy
 In POP, Most function uses Global data for
sharing that can be accessed freely from
function to function in the system
 POP does not have any proper way for hiding
data so it is less secure
 In POP, Overloading is not possible
 Example of POPL are : C, VB, FORTRAN,
Pascal
Prepared by: Said H Said
The University of Dodoma
4
Object Oriented
programing(OOP)
 Program is divided into parts called objects
 Importance is given to data rather than
procedures or functions to mimic real world
realm
 OOP has access specifies named Public,
Private, Protected, etc
 In OOP, objects can move and communicate
with each other through member
functions/methods
Prepared by: Said H Said
The University of Dodoma
5
OOP cont…..
 OOP provides an easy way to add new data
and function/methods
 In OOP, data cannot move easily from function
to function, it can be kept public or private so we
can control the access of data
 OOP provides Data Hiding so provides more
security
 In OOP, overloading is possible in the form of
Function Overloading and Operator Overloading
 Example of OOP are : C++, JAVA, VB.NET,
C#.NET Prepared by: Said H Said
The University of Dodoma
6
POP SRUCTURE……
Main Function
Function 1 Function 2 Function 3
Function 2 Function 5
Function N
Prepared by: Said H Said
The University of Dodoma
7
OOP SRUCTURE……
Class 1 {
Data
Methods
}
Class 2 {
Data
Methods
}
Class n {
Data
Methods
}
Prepared by: Said H Said
The University of Dodoma
Java
 General purpose programming language
 Is simple
 Is scalable
 Is object oriented
 Is similar to C and C++
8
Prepared by: Said H Said
The University of Dodoma
9
Java
 A Programming Language and a Platform
 Java Platform
 Java Virtual Machine (Java VM)
 Java Application Programming Interface
Prepared by: Said H Said
The University of Dodoma
10
Java
 It is Platform Independent (Write Once Run
Anywhere)
Prepared by: Said H Said
The University of Dodoma
11
Advantages of Java
 Easy to learn, Familiar C++ like syntax
 Pure Object Oriented Language
 Extensive API, which means that
programmers write lesser amount of code
 Extensive Documentation
 Faster Application Development because of
code re-use
 Platform Independence
 Automatic Garbage Collection
Prepared by: Said H Said
The University of Dodoma
12
History of Java
 Project Green by Sun Microsystems to create
a pure object oriented language based on
C++, to overcome the limitations and
complexities of C++ (1990)
 Aimed at embedded systems in consumer
electronic devices (interactive television,
VCR, washing machines, etc.)
 Originally named ‘Oak’
Prepared by: Said H Said
The University of Dodoma
13
History of Java
 Failed to win recognition in embedded
systems and embedded systems were not
making a rapid progress
 During the same period world wide web
(www) was going through an exponential
growth
 Oak was aimed at supporting interactive web
pages together with the development of a
new web browser, Web Runner (1994)
Prepared by: Said H Said
The University of Dodoma
14
History of Java
 ‘Oak’ renamed ‘Java’ and ‘Web Runner’
renamed ‘Hot Java’
 Formal Announcement of Java Language
and Hot Java browser in Sun World ’95
 Commercial web browsers starting with
Netscape begin supporting Java
 Later Java evolved into other technologies
like Java applets (interactive web content)
Prepared by: Said H Said
The University of Dodoma
15
Use of Java
 Desktop Applications such as acrobat reader,
media player, antivirus etc.
 Web Applications such as irctc.co.in,
javatpoint.com etc.
 Enterprise Applications such as banking
applications.
 Mobile
 Embedded System
 Smart Card
 Robotics
 Games etc.
Prepared by: Said H Said
The University of Dodoma
Prepared by: Said H Said The University of
Dodoma
16
Different Java Technologies
 JVM (Java Virtual Machine): is an abstract machine. It
is a specification that provides runtime environment in
which java bytecode can be executed.
 JVMs are available for many hardware and software
platforms. JVM, JRE and JDK are platform dependent
because configuration of each OS differs. But, Java is
platform independent.
 The JVM performs following main tasks:
 Loads code
 Verifies code
 Executes code
 Provides runtime environment
Prepared by: Said H Said
The University of Dodoma
17
Different Java Technologies
 JRE: is an acronym for Java Runtime Environment.
 It is used to provide runtime environment.
 It is the implementation of JVM.
 It physically exists.
 It contains set of libraries + other files that JVM uses at
runtime.
 Implementation of JVMs are also actively released
by other companies besides Sun Micro Systems.
Prepared by: Said H Said
The University of Dodoma
18
Different Java Technologies
 JDK is an acronym for Java Development Kit.
 It physically exists.
 It contains JRE + development tools.
Prepared by: Said H Said
The University of Dodoma
Prepared by: Said H Said
The University of Dodoma
19
Different Java Technologies
Prepared by: Said H Said
The University of Dodoma
20
Different Java Technologies
 IDE’s (Integrated Development Environments): are
tools used for efficient software development
 Different Components of an IDE :
 Editor
 Linker
 Compiler
 Debugger
 All the different components are seamlessly
integrated in an IDE making it easy to use
Prepared by: Said H Said
The University of Dodoma
21
IDEs cont…
 For different programming languages,
different IDE’s are available
 Java Language :
JBuilder, Kawa, NetBeans, eclipse etc.
 C Language :
Borland C, Turbo C, etc.
 IDE’s have capabilities different from each
other and one has to learn the use of an IDE
to get the maximum return
22
Compilation and Execution of
a Java Program
 Create a source file (e.g. :- a file named
“HelloWorld.java”) and type in the source code.
/**
* The HelloWorld class implements an application that
* displays "Hello World!" to the standard output.
*/
public class HelloWorld {
public static void main(String[] args) {
// Display "Hello World!"
System.out.println("Hello World!");
}
}
Prepared by: Said H Said
The University of Dodoma
23
Compilation and Execution of
a Java Program
 Compile the source file
 Use the Java compiler :
javac HelloWorld.java
 A byte code file (i.e. a file understandable by the
Java Virtual Machine) is created
 Run the program contained in the byte code
file
 Use the command :
java HelloWorld
Prepared by: Said H Said
The University of Dodoma

Más contenido relacionado

Similar a Lecture_01.pdf

Portable Code Compiler
Portable Code CompilerPortable Code Compiler
Portable Code Compiler
ijtsrd
 
Unesco Presentation
Unesco PresentationUnesco Presentation
Unesco Presentation
Umesh
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
MCM COmpetitive Classes
 
Analysis Of The Original Version Of Java
Analysis Of The Original Version Of JavaAnalysis Of The Original Version Of Java
Analysis Of The Original Version Of Java
Amanda Brady
 

Similar a Lecture_01.pdf (20)

Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java Programming Basics
Java Programming BasicsJava Programming Basics
Java Programming Basics
 
CSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.pptCSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.ppt
 
Portable Code Compiler
Portable Code CompilerPortable Code Compiler
Portable Code Compiler
 
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGEA CASE STUDY  JAVA IS SECURE PROGRAMMING LANGUAGE
A CASE STUDY JAVA IS SECURE PROGRAMMING LANGUAGE
 
USES of java.pptx
USES of java.pptxUSES of java.pptx
USES of java.pptx
 
130700548484460000
130700548484460000130700548484460000
130700548484460000
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
 
Unesco Presentation
Unesco PresentationUnesco Presentation
Unesco Presentation
 
Android_Studio_Structure.docx
Android_Studio_Structure.docxAndroid_Studio_Structure.docx
Android_Studio_Structure.docx
 
Java presentation
Java presentationJava presentation
Java presentation
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...C,c++,java,php,.net training institute in delhi, best training institute for ...
C,c++,java,php,.net training institute in delhi, best training institute for ...
 
gopal hp
gopal hpgopal hp
gopal hp
 
java notes.docx
java notes.docxjava notes.docx
java notes.docx
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
1.INTRODUCTION TO JAVA_2022 MB.ppt      .1.INTRODUCTION TO JAVA_2022 MB.ppt      .
1.INTRODUCTION TO JAVA_2022 MB.ppt .
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application Development
 
15 Top reasons to choose Java for Backend Development
15 Top reasons to choose Java for Backend Development15 Top reasons to choose Java for Backend Development
15 Top reasons to choose Java for Backend Development
 
Analysis Of The Original Version Of Java
Analysis Of The Original Version Of JavaAnalysis Of The Original Version Of Java
Analysis Of The Original Version Of Java
 
13 Best Mobile IDEs for Android.pdf
13 Best Mobile IDEs for Android.pdf13 Best Mobile IDEs for Android.pdf
13 Best Mobile IDEs for Android.pdf
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Último (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 

Lecture_01.pdf

  • 1. 1 Object Oriented Programming-Java OOP vs POP, Java, Java Technologies, Prepared by: Said H Said The University of Dodoma
  • 2. 2 Procedural Oriented Programing (POP)  Program is divided into small parts called functions  Importance is not given to data but to functions as well as sequence of actions to be done  Does not have any access specifies  In POP, Data can move freely from function to function in the system Prepared by: Said H Said The University of Dodoma
  • 3. 3 POP Cont…  To add new data and function in POP is not so easy  In POP, Most function uses Global data for sharing that can be accessed freely from function to function in the system  POP does not have any proper way for hiding data so it is less secure  In POP, Overloading is not possible  Example of POPL are : C, VB, FORTRAN, Pascal Prepared by: Said H Said The University of Dodoma
  • 4. 4 Object Oriented programing(OOP)  Program is divided into parts called objects  Importance is given to data rather than procedures or functions to mimic real world realm  OOP has access specifies named Public, Private, Protected, etc  In OOP, objects can move and communicate with each other through member functions/methods Prepared by: Said H Said The University of Dodoma
  • 5. 5 OOP cont…..  OOP provides an easy way to add new data and function/methods  In OOP, data cannot move easily from function to function, it can be kept public or private so we can control the access of data  OOP provides Data Hiding so provides more security  In OOP, overloading is possible in the form of Function Overloading and Operator Overloading  Example of OOP are : C++, JAVA, VB.NET, C#.NET Prepared by: Said H Said The University of Dodoma
  • 6. 6 POP SRUCTURE…… Main Function Function 1 Function 2 Function 3 Function 2 Function 5 Function N Prepared by: Said H Said The University of Dodoma
  • 7. 7 OOP SRUCTURE…… Class 1 { Data Methods } Class 2 { Data Methods } Class n { Data Methods } Prepared by: Said H Said The University of Dodoma
  • 8. Java  General purpose programming language  Is simple  Is scalable  Is object oriented  Is similar to C and C++ 8 Prepared by: Said H Said The University of Dodoma
  • 9. 9 Java  A Programming Language and a Platform  Java Platform  Java Virtual Machine (Java VM)  Java Application Programming Interface Prepared by: Said H Said The University of Dodoma
  • 10. 10 Java  It is Platform Independent (Write Once Run Anywhere) Prepared by: Said H Said The University of Dodoma
  • 11. 11 Advantages of Java  Easy to learn, Familiar C++ like syntax  Pure Object Oriented Language  Extensive API, which means that programmers write lesser amount of code  Extensive Documentation  Faster Application Development because of code re-use  Platform Independence  Automatic Garbage Collection Prepared by: Said H Said The University of Dodoma
  • 12. 12 History of Java  Project Green by Sun Microsystems to create a pure object oriented language based on C++, to overcome the limitations and complexities of C++ (1990)  Aimed at embedded systems in consumer electronic devices (interactive television, VCR, washing machines, etc.)  Originally named ‘Oak’ Prepared by: Said H Said The University of Dodoma
  • 13. 13 History of Java  Failed to win recognition in embedded systems and embedded systems were not making a rapid progress  During the same period world wide web (www) was going through an exponential growth  Oak was aimed at supporting interactive web pages together with the development of a new web browser, Web Runner (1994) Prepared by: Said H Said The University of Dodoma
  • 14. 14 History of Java  ‘Oak’ renamed ‘Java’ and ‘Web Runner’ renamed ‘Hot Java’  Formal Announcement of Java Language and Hot Java browser in Sun World ’95  Commercial web browsers starting with Netscape begin supporting Java  Later Java evolved into other technologies like Java applets (interactive web content) Prepared by: Said H Said The University of Dodoma
  • 15. 15 Use of Java  Desktop Applications such as acrobat reader, media player, antivirus etc.  Web Applications such as irctc.co.in, javatpoint.com etc.  Enterprise Applications such as banking applications.  Mobile  Embedded System  Smart Card  Robotics  Games etc. Prepared by: Said H Said The University of Dodoma
  • 16. Prepared by: Said H Said The University of Dodoma 16 Different Java Technologies  JVM (Java Virtual Machine): is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.  JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.  The JVM performs following main tasks:  Loads code  Verifies code  Executes code  Provides runtime environment Prepared by: Said H Said The University of Dodoma
  • 17. 17 Different Java Technologies  JRE: is an acronym for Java Runtime Environment.  It is used to provide runtime environment.  It is the implementation of JVM.  It physically exists.  It contains set of libraries + other files that JVM uses at runtime.  Implementation of JVMs are also actively released by other companies besides Sun Micro Systems. Prepared by: Said H Said The University of Dodoma
  • 18. 18 Different Java Technologies  JDK is an acronym for Java Development Kit.  It physically exists.  It contains JRE + development tools. Prepared by: Said H Said The University of Dodoma
  • 19. Prepared by: Said H Said The University of Dodoma 19 Different Java Technologies
  • 20. Prepared by: Said H Said The University of Dodoma 20 Different Java Technologies  IDE’s (Integrated Development Environments): are tools used for efficient software development  Different Components of an IDE :  Editor  Linker  Compiler  Debugger  All the different components are seamlessly integrated in an IDE making it easy to use
  • 21. Prepared by: Said H Said The University of Dodoma 21 IDEs cont…  For different programming languages, different IDE’s are available  Java Language : JBuilder, Kawa, NetBeans, eclipse etc.  C Language : Borland C, Turbo C, etc.  IDE’s have capabilities different from each other and one has to learn the use of an IDE to get the maximum return
  • 22. 22 Compilation and Execution of a Java Program  Create a source file (e.g. :- a file named “HelloWorld.java”) and type in the source code. /** * The HelloWorld class implements an application that * displays "Hello World!" to the standard output. */ public class HelloWorld { public static void main(String[] args) { // Display "Hello World!" System.out.println("Hello World!"); } } Prepared by: Said H Said The University of Dodoma
  • 23. 23 Compilation and Execution of a Java Program  Compile the source file  Use the Java compiler : javac HelloWorld.java  A byte code file (i.e. a file understandable by the Java Virtual Machine) is created  Run the program contained in the byte code file  Use the command : java HelloWorld Prepared by: Said H Said The University of Dodoma