SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a Lecture_01.pdf

Introduction to java
Introduction to javaIntroduction to java
Introduction to javashwanjava
 
CSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.pptCSE215_Module_01_Introduction.ppt
CSE215_Module_01_Introduction.pptRashedurRahman18
 
Portable Code Compiler
Portable Code CompilerPortable Code Compiler
Portable Code Compilerijtsrd
 
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 LANGUAGENathan Mathis
 
USES of java.pptx
USES of java.pptxUSES of java.pptx
USES of java.pptxXanGwaps
 
Unesco Presentation
Unesco PresentationUnesco Presentation
Unesco PresentationUmesh
 
Android_Studio_Structure.docx
Android_Studio_Structure.docxAndroid_Studio_Structure.docx
Android_Studio_Structure.docxKNANTHINIMCA
 
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.pptxSuganthiDPSGRKCW
 
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
 
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 .happycocoman
 
Introduction To Mobile Application Development
Introduction To Mobile Application DevelopmentIntroduction To Mobile Application Development
Introduction To Mobile Application DevelopmentSyed Absar
 
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 DevelopmentYour Team in India
 
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 JavaAmanda Brady
 
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.pdfiDataScientists
 

Semelhante 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

4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Association for Project Management
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
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
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptxAneriPatwari
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptxmary850239
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17Celine George
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
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
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Último (20)

4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
Team Lead Succeed – Helping you and your team achieve high-performance teamwo...
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
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
 
ARTERIAL BLOOD GAS ANALYSIS........pptx
ARTERIAL BLOOD  GAS ANALYSIS........pptxARTERIAL BLOOD  GAS ANALYSIS........pptx
ARTERIAL BLOOD GAS ANALYSIS........pptx
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 
4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx4.9.24 School Desegregation in Boston.pptx
4.9.24 School Desegregation in Boston.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17How to Manage Buy 3 Get 1 Free in Odoo 17
How to Manage Buy 3 Get 1 Free in Odoo 17
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.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
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

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