SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
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.pdfNirmal Dwivedi
 
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Ữ Â...Nguyen Thanh Tu Collection
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 

Dernier (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
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Ữ Â...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

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