SlideShare a Scribd company logo
1 of 26
C O U R S E I N S T R U C TO R : FA H A D S H A H Z A D
f a h a d s h a h z a d @ l i v e . c o m 1
REFERENCE BOOKS / WEBSOURCE
• Beginning Android 2 by Mark L. Murphy
• Android Application Development for Dummies by Barry Burd
• Android Development Tutorials by Lars Vogel
• https://www.tutorialspoint.com/java/
• https://www.w3resource.com/java-exercises/index.php
2
MARKS CRITERIA
•Quiz 10%
• Assignments 5%
• Project Presentation 15%
• Mid Term Exam 30%
• Final Term Exam 40%
3
GENERAL RULES
• Cell phones should be powered off
• Eatables are not allowed in the class
• The teacher will not tolerate any disruptive behavior in the class
• The dress code has to be observed, no warnings will be given and violators will be asked
politely to leave the class, consequently will be marked as absent
4
MOBILE APP DEVELOPMENT
+ =
5
MOBILE APP DEVELOPMENT
WE WILL START WITH
6
LECTURE OUTLINE
• What is Java
• Overview of Java
• History of Java
• Features of Java
• C++ Vs Java
• First Java Hello world Program
• Parameters of first Java Program
• Environmental Components of Java
7
WHAT IS JAVA
• Java is a high-level programming language originally developed by Sun Microsystems
and released in 1995.
• Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions
of UNIX.
• This course gives a complete understanding of Java.
• This reference will take you through simple and practical approaches while learning
Java Programming language. 8
OVERVIEW OF JAVA
• The latest release of the Java Standard Edition is Java SE 8.
• With the advancement of Java and its widespread popularity, multiple configurations
were built to suit various types of platforms.
• For example: J2EE for Enterprise Applications, J2ME for Mobile Applications.
• The new J2 versions were renamed as Java SE, Java EE, and Java ME respectively.
• Java is guaranteed to be Write Once, Run Anywhere.
9
HISTORY OF JAVA
• James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language
project in June 1991. The small team of sun engineers called Green Team.
• 2) Originally designed for small, embedded systems in electronic appliances like set-
top boxes.
• 3) Firstly, it was called "Greentalk" by James Gosling, and file extension was .gt.
• 4) After that, it was called Oak and was developed as a part of the Green project.
10
WHY JAVA NAMED OAK?
• Why Oak? Oak is a symbol of strength and chosen as a national tree of many
countries like U.S.A., France, Germany, Romania, etc.
• In 1995, Oak was renamed as "Java" because it was already a trademark by Oak
Technologies.
11
WHY JAVA PROGRAMMING NAMED "JAVA"?
• Why had they chosen java name for java language? The team gathered to choose a
new name. The suggested words were "dynamic", "revolutionary", "Silk", "jolt", "DNA",
etc. They wanted something that reflected the essence of the technology:
revolutionary, dynamic, lively, cool, unique, and easy to spell and fun to say.
• According to James Gosling, "Java was one of the top choices along with Silk". Since
Java was so unique, most of the team members preferred Java than other names.
• Java is an island of Indonesia where first coffee was produced (called java coffee).
• Notice that Java is just a name, not an acronym.
• Initially developed by James Gosling at Sun Microsystems (which is now a subsidiary
Oracle Corporation) and released in 1995.
• In 1995, Time magazine called Java one of the Ten Best Products of 1995.
• JDK 1.0 released in(January 23, 1996).
12
JAVA VERSION HISTORY
• JDK Alpha and Beta (1995)
• JDK 1.0 (23rd Jan 1996)
• JDK 1.1 (19th Feb 1997)
• J2SE 1.2 (8th Dec 1998)
• J2SE 1.3 (8th May 2000)
• J2SE 1.4 (6th Feb 2002)
• J2SE 5.0 (30th Sep 2004)
• Java SE 6 (11th Dec 2006)
• Java SE 7 (28th July 2011)
• Java SE 8 (18th March 2014)
• Java SE 9 (21st Sep 2017)
• Java SE 10 (20th March 2018)
13
FEATURES OF JAVA
14
JAVA IS:
• Object Oriented − In Java, everything is an Object. Java can be easily extended since
it is based on the Object model.
• Platform Independent − Unlike many other programming languages including C and
C++, when Java is compiled, it is not compiled into platform specific machine, rather
into platform independent byte code. This byte code is distributed over the web and
interpreted by the Virtual Machine (JVM) on whichever platform it is being run on.
• Simple − Java is designed to be easy to learn. If you understand the basic concept of
OOP Java, it would be easy to master.
15
What is
OOP ?
Assignment 
What is OOP ?
What is Basic Concept of OOP
Submission Date 4/4/2019 before
lecture
JAVA IS:
• Architecture-neutral − Java compiler generates an architecture-neutral object file
format, which makes the compiled code executable on many processors, with the
presence of Java runtime system.
• Portable − Being architecture-neutral and having no implementation dependent
aspects of the specification makes Java portable. Compiler in Java is written in ANSI C
with a clean portability boundary, which is a POSIX subset.
16
JAVA IS:
• Robust − Java makes an effort to eliminate error prone situations by emphasizing
mainly on compile time error checking and runtime checking.
• Multithreaded − With Java's multithreaded feature it is possible to write programs
that can perform many tasks simultaneously. This design feature allows the
to construct interactive applications that can run smoothly.
• Interpreted − Java byte code is translated on the fly to native machine instructions
and is not stored anywhere. The development process is more rapid and analytical
since the linking is an incremental and light-weight process.
17
JAVA IS:
• High Performance − With the use of Just-In-Time compilers, Java enables high
performance.
• Distributed − Java is designed for the distributed environment of the internet.
• Dynamic − Java is considered to be more dynamic than C or C++ since it is designed
to adapt to an evolving environment. Java programs can carry extensive amount of
run-time information that can be used to verify and resolve accesses to objects on
time.
18
JAVA IS:
• Secure − With Java's secure feature it enables to develop virus-free, tamper-free
systems. Authentication techniques are based on public-key encryption.
19
C++ VS JAVA
• C++ is platform-dependent.
• C++ is mainly used for system programming.
• C++ supports operator overloading.
• C++ supports pointers. You can write pointer
program in C++.
• C++ is nearer to hardware.
• Java is platform-independent.
• Java is mainly used for application
programming. It is widely used in window,
web-based, enterprise and mobile
applications.
• Java doesn't support operator overloading.
• Java supports pointer internally. However,
you can't write the pointer program in java. It
means java has restricted pointer support in
java.
• Java is not so interactive with hardware.
20
CREATING HELLO WORLD EXAMPLE
• class Simple{
• public static void main(String args[]){
• System.out.println(“Once In a LiFeTime");
• }
• }
• Compilation Flow:
• When we compile Java program using javac tool, java compiler converts the source
code into byte code.
21
PARAMETERS USED IN FIRST JAVA PROGRAM
• class keyword is used to declare a class in java.
• public keyword is an access modifier which represents visibility. It means it is visible to
all.
• static is a keyword. If we declare any method as static, it is known as the static
method. The core advantage of the static method is that there is no need to create
object to invoke the static method. The main method is executed by the JVM, so it
doesn't require to create an object to invoke the main method. So it saves memory.
• void is the return type of the method. It means it doesn't return any value.
• main represents the starting point of the program.
• String[] args is used for command line argument. We will learn it later.
• System.out.println() is used to print statement. Here, System is a class, out is the
object of PrintStream class, println() is the method of PrintStream class. We will learn
about the internal working of System.out.println statement later.
22
JAVA ENVIRONMENTAL COMPONENTS
JDK, JRE, AND JVM
• JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because
it doesn't physically exist. It is a specification that provides a runtime environment in
which Java bytecode can be executed. It can also run those programs which are written
in other languages and compiled to Java bytecode.
• JVMs are available for many hardware and software platforms. JVM, JRE, and JDK are
platform dependent because the configuration of each OSis different from each other.
However, Java is platform independent. There are three notions of the
JVM: specification, implementation, and instance.
• The JVM performs the following main tasks:
• Loads code
• Verifies code
• Executes code
• Provides runtime environment 23
JAVA ENVIRONMENTAL COMPONENTS
JDK, JRE, AND JVM
• JRE is an acronym for Java Runtime Environment. It is also written as Java RTE. The Java
Runtime Environment is a set of software tools which are used for developing Java
applications. It is used to provide the runtime environment. It is the implementation of
JVM. It physically exists. It contains a set of libraries + other files that JVM uses at
runtime.
24
JAVA ENVIRONMENTAL COMPONENTS
JDK, JRE, AND JVM
• JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) is a
software development environment which is used to develop Java applications
and applets. It physically exists. It contains JRE + development tools.
25
26

More Related Content

What's hot (17)

History of Java 1/2
History of Java 1/2History of Java 1/2
History of Java 1/2
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Evolution of java By Abbas khan
Evolution of java   By Abbas khan Evolution of java   By Abbas khan
Evolution of java By Abbas khan
 
Presentation5
Presentation5Presentation5
Presentation5
 
Java (1)
Java (1)Java (1)
Java (1)
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Lec 3 01_aug13
Lec 3 01_aug13Lec 3 01_aug13
Lec 3 01_aug13
 
Evolution Of Java
Evolution Of JavaEvolution Of Java
Evolution Of Java
 
Features of java 02
Features of java 02Features of java 02
Features of java 02
 
Java Presentation
 Java Presentation Java Presentation
Java Presentation
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
 
Java 1
Java 1Java 1
Java 1
 
Ch2
Ch2Ch2
Ch2
 
Core java
Core java Core java
Core java
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 

Similar to Java Basics

what is java.pdf
what is java.pdfwhat is java.pdf
what is java.pdfXanGwaps
 
Chapter-1 Introduction.pptx
Chapter-1 Introduction.pptxChapter-1 Introduction.pptx
Chapter-1 Introduction.pptxSumanBhandari40
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxMurugesh33
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxMurugesh33
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programmingElizabeth Thomas
 
1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptxBhargaviDalal3
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
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
 
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
 

Similar to Java Basics (20)

1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
what is java.pdf
what is java.pdfwhat is java.pdf
what is java.pdf
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
Java
JavaJava
Java
 
PALASH SL GUPTA
PALASH SL GUPTAPALASH SL GUPTA
PALASH SL GUPTA
 
Chapter-1 Introduction.pptx
Chapter-1 Introduction.pptxChapter-1 Introduction.pptx
Chapter-1 Introduction.pptx
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
unit1.pptx
unit1.pptxunit1.pptx
unit1.pptx
 
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
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 ...
 
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
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 

Java Basics

  • 1. C O U R S E I N S T R U C TO R : FA H A D S H A H Z A D f a h a d s h a h z a d @ l i v e . c o m 1
  • 2. REFERENCE BOOKS / WEBSOURCE • Beginning Android 2 by Mark L. Murphy • Android Application Development for Dummies by Barry Burd • Android Development Tutorials by Lars Vogel • https://www.tutorialspoint.com/java/ • https://www.w3resource.com/java-exercises/index.php 2
  • 3. MARKS CRITERIA •Quiz 10% • Assignments 5% • Project Presentation 15% • Mid Term Exam 30% • Final Term Exam 40% 3
  • 4. GENERAL RULES • Cell phones should be powered off • Eatables are not allowed in the class • The teacher will not tolerate any disruptive behavior in the class • The dress code has to be observed, no warnings will be given and violators will be asked politely to leave the class, consequently will be marked as absent 4
  • 6. MOBILE APP DEVELOPMENT WE WILL START WITH 6
  • 7. LECTURE OUTLINE • What is Java • Overview of Java • History of Java • Features of Java • C++ Vs Java • First Java Hello world Program • Parameters of first Java Program • Environmental Components of Java 7
  • 8. WHAT IS JAVA • Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. • Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. • This course gives a complete understanding of Java. • This reference will take you through simple and practical approaches while learning Java Programming language. 8
  • 9. OVERVIEW OF JAVA • The latest release of the Java Standard Edition is Java SE 8. • With the advancement of Java and its widespread popularity, multiple configurations were built to suit various types of platforms. • For example: J2EE for Enterprise Applications, J2ME for Mobile Applications. • The new J2 versions were renamed as Java SE, Java EE, and Java ME respectively. • Java is guaranteed to be Write Once, Run Anywhere. 9
  • 10. HISTORY OF JAVA • James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun engineers called Green Team. • 2) Originally designed for small, embedded systems in electronic appliances like set- top boxes. • 3) Firstly, it was called "Greentalk" by James Gosling, and file extension was .gt. • 4) After that, it was called Oak and was developed as a part of the Green project. 10
  • 11. WHY JAVA NAMED OAK? • Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., France, Germany, Romania, etc. • In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies. 11
  • 12. WHY JAVA PROGRAMMING NAMED "JAVA"? • Why had they chosen java name for java language? The team gathered to choose a new name. The suggested words were "dynamic", "revolutionary", "Silk", "jolt", "DNA", etc. They wanted something that reflected the essence of the technology: revolutionary, dynamic, lively, cool, unique, and easy to spell and fun to say. • According to James Gosling, "Java was one of the top choices along with Silk". Since Java was so unique, most of the team members preferred Java than other names. • Java is an island of Indonesia where first coffee was produced (called java coffee). • Notice that Java is just a name, not an acronym. • Initially developed by James Gosling at Sun Microsystems (which is now a subsidiary Oracle Corporation) and released in 1995. • In 1995, Time magazine called Java one of the Ten Best Products of 1995. • JDK 1.0 released in(January 23, 1996). 12
  • 13. JAVA VERSION HISTORY • JDK Alpha and Beta (1995) • JDK 1.0 (23rd Jan 1996) • JDK 1.1 (19th Feb 1997) • J2SE 1.2 (8th Dec 1998) • J2SE 1.3 (8th May 2000) • J2SE 1.4 (6th Feb 2002) • J2SE 5.0 (30th Sep 2004) • Java SE 6 (11th Dec 2006) • Java SE 7 (28th July 2011) • Java SE 8 (18th March 2014) • Java SE 9 (21st Sep 2017) • Java SE 10 (20th March 2018) 13
  • 15. JAVA IS: • Object Oriented − In Java, everything is an Object. Java can be easily extended since it is based on the Object model. • Platform Independent − Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by the Virtual Machine (JVM) on whichever platform it is being run on. • Simple − Java is designed to be easy to learn. If you understand the basic concept of OOP Java, it would be easy to master. 15 What is OOP ? Assignment  What is OOP ? What is Basic Concept of OOP Submission Date 4/4/2019 before lecture
  • 16. JAVA IS: • Architecture-neutral − Java compiler generates an architecture-neutral object file format, which makes the compiled code executable on many processors, with the presence of Java runtime system. • Portable − Being architecture-neutral and having no implementation dependent aspects of the specification makes Java portable. Compiler in Java is written in ANSI C with a clean portability boundary, which is a POSIX subset. 16
  • 17. JAVA IS: • Robust − Java makes an effort to eliminate error prone situations by emphasizing mainly on compile time error checking and runtime checking. • Multithreaded − With Java's multithreaded feature it is possible to write programs that can perform many tasks simultaneously. This design feature allows the to construct interactive applications that can run smoothly. • Interpreted − Java byte code is translated on the fly to native machine instructions and is not stored anywhere. The development process is more rapid and analytical since the linking is an incremental and light-weight process. 17
  • 18. JAVA IS: • High Performance − With the use of Just-In-Time compilers, Java enables high performance. • Distributed − Java is designed for the distributed environment of the internet. • Dynamic − Java is considered to be more dynamic than C or C++ since it is designed to adapt to an evolving environment. Java programs can carry extensive amount of run-time information that can be used to verify and resolve accesses to objects on time. 18
  • 19. JAVA IS: • Secure − With Java's secure feature it enables to develop virus-free, tamper-free systems. Authentication techniques are based on public-key encryption. 19
  • 20. C++ VS JAVA • C++ is platform-dependent. • C++ is mainly used for system programming. • C++ supports operator overloading. • C++ supports pointers. You can write pointer program in C++. • C++ is nearer to hardware. • Java is platform-independent. • Java is mainly used for application programming. It is widely used in window, web-based, enterprise and mobile applications. • Java doesn't support operator overloading. • Java supports pointer internally. However, you can't write the pointer program in java. It means java has restricted pointer support in java. • Java is not so interactive with hardware. 20
  • 21. CREATING HELLO WORLD EXAMPLE • class Simple{ • public static void main(String args[]){ • System.out.println(“Once In a LiFeTime"); • } • } • Compilation Flow: • When we compile Java program using javac tool, java compiler converts the source code into byte code. 21
  • 22. PARAMETERS USED IN FIRST JAVA PROGRAM • class keyword is used to declare a class in java. • public keyword is an access modifier which represents visibility. It means it is visible to all. • static is a keyword. If we declare any method as static, it is known as the static method. The core advantage of the static method is that there is no need to create object to invoke the static method. The main method is executed by the JVM, so it doesn't require to create an object to invoke the main method. So it saves memory. • void is the return type of the method. It means it doesn't return any value. • main represents the starting point of the program. • String[] args is used for command line argument. We will learn it later. • System.out.println() is used to print statement. Here, System is a class, out is the object of PrintStream class, println() is the method of PrintStream class. We will learn about the internal working of System.out.println statement later. 22
  • 23. JAVA ENVIRONMENTAL COMPONENTS JDK, JRE, AND JVM • JVM (Java Virtual Machine) is an abstract machine. It is called a virtual machine because it doesn't physically exist. It is a specification that provides a runtime environment in which Java bytecode can be executed. It can also run those programs which are written in other languages and compiled to Java bytecode. • JVMs are available for many hardware and software platforms. JVM, JRE, and JDK are platform dependent because the configuration of each OSis different from each other. However, Java is platform independent. There are three notions of the JVM: specification, implementation, and instance. • The JVM performs the following main tasks: • Loads code • Verifies code • Executes code • Provides runtime environment 23
  • 24. JAVA ENVIRONMENTAL COMPONENTS JDK, JRE, AND JVM • JRE is an acronym for Java Runtime Environment. It is also written as Java RTE. The Java Runtime Environment is a set of software tools which are used for developing Java applications. It is used to provide the runtime environment. It is the implementation of JVM. It physically exists. It contains a set of libraries + other files that JVM uses at runtime. 24
  • 25. JAVA ENVIRONMENTAL COMPONENTS JDK, JRE, AND JVM • JDK is an acronym for Java Development Kit. The Java Development Kit (JDK) is a software development environment which is used to develop Java applications and applets. It physically exists. It contains JRE + development tools. 25
  • 26. 26