SlideShare a Scribd company logo
Africa Information
Technology Initiative
Lecture 1:
Introduction to Java
AITI 2009
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Agenda
• What makes Java special?
• Advantages and disadvantages to using
Java.
• Methodology for developing applications.
2
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Compiler
…
a = b + c
…
…
ld $r1, a
ld $r2, b
add $r3, $r1, $r2
st a, $r3
…
Compiler
High-Level
Code
Machine Code
• A program that translates a programming
language into machine code is called a compiler
• Typically, we must have a compiler for each
operating system/machine combination (platform)
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Compiling Computer Programs
• Because different platforms require different machine
code, you must compile programs separately for
each platform, then execute the machine code.
program
compiler
compiler
compiler
Win
Mac
Unix
machine codemachine code
machine code
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
The Java Compiler is Different!
• The Java compiler produces an
intermediate format called bytecode.
• Bytecode is not machine code for any
real computer.
• Bytecode is machine code for a model
computer.
– This model computer is called the Java
Virtual Machine.
Java Program
compiler
Java Bytecode
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Java Interpreter
• A Java Interpreter is required to execute the
bytecode on a real computer.
• A Java Interpreter converts the bytecode into
machine code.
– As the program executes
– Simulate the execution of the Java Virtual Machine on
the real computer
• You can run bytecode on any computer that has
a Java Interpreter (JRE) installed!
– Only have to compile once
– Can distribute the same bytecode to everyone
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
The Java Approach
Java Program
compiler
Java bytecode
Win
Mac
Unix
Interpreter
Interpreter
Interpreter
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Advantages of Using Java
• Once a Java program is compiled you can run the
bytecode on any device with a Java Interpreter.
– Because you do not have to recompile the program for each
machine, Java is device independent.
• Java is safe. The Java language and compiler restrict
certain operations to prevent errors.
– Would you want an application to have total control of your
phone?
• Make calls, send SMS messages?
• Java standardizes many useful structures and
operations such as lists, managing network connections,
and providing graphical user interfaces
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Disadvantages of Using Java
• Running bytecode through an interpreter is not
as fast as running machine code
– But this disadvantage is slowly disappearing
• Using device specific features (e.g., bluetooth) is
difficult sometimes because Java is device-
independent.
• In order to run a Java program on multiple
devices, each must have a Java Interpreter
– Ex: most Nokia phones come with Java Interpreter
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Programming Methodology
1. Specify and analyze the problem
• Remove ambiguity
• Decide on inputs/outputs and algorithms
1. Design the program solution
• Organize problem into smaller pieces
• Identify existing code to reuse!
1. Implementation (programming)
2. Test and verify implementation
3. Maintain and update program
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Writing Good Code
• A program that meets specification is not
necessarily good.
• Will you be able to make changes to it?
– Will you understand it after some time?
• Others might need to look at your code
– Can they understand it?
• Write your program so that is easy to
understand and extend!
– Spend extra time thinking about these issues.
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Example Code: Comments
/* The HelloWorld class prints “Hello,
World!” to the screen */
public class HelloWorld {
public static void main(String[] args) {
// Prints “Hello, World!”
System.out.println("Hello, World!");
// Exit the program
System.exit(0);
}
}
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Comments
• Comments are used to describe what your code
does as an aid for you or others reading your
code. The Java compiler ignores them.
• Comments are made using //, which comments
to the end of the line, or /* */, which
comments everything inside of it (including
multiple lines)
• Two example comments:
– /* The HelloWorld class prints “Hello, World!” to the
screen */
– // Prints “Hello, World!”
http://aiti.mit.eduAfrica Information Technology Initiative © 2009
Comments on Commenting
• You may collaborate on software projects
with people around the world who you’ll
never meet
• Should be able to figure out how code
works by reading comments alone
• Anything that is not self-evident needs a
comment
• 50% of your code might be comments
• Coding is easy, commenting is not

More Related Content

What's hot (20)

PPTX
Java Lecture 1
Qualys
 
PPT
Java features
myrajendra
 
PPTX
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 
PPTX
Core Java
NA
 
PPTX
Java Programming (M&M)
mafffffe19
 
PPSX
Industrial Training Report on Java Technology.
Ritesh Kumar Bhanu
 
PDF
Java Programming Basics
Rkrishna Mishra
 
PDF
Introduction to Java
Professional Guru
 
PPTX
Java Intro
Nazmul Hasan Rupok
 
PPTX
Features of java 02
University of Potsdam
 
DOCX
Industrial Training report on java
Softvision Info Solutions Private Limited
 
PPTX
Java seminar
devendrakhairwa
 
PPTX
A Comparison of .NET Framework vs. Java Virtual Machine
Abdelrahman Hosny
 
PPTX
C,c++,java,php,.net training institute in delhi, best training institute for ...
MCM COmpetitive Classes
 
PPTX
Programming in Java
Abhilash Nair
 
PDF
130700548484460000
Tanzeel Ahmad
 
PPT
Java Programming : introduction
Kongu Engineering College, Perundurai, Erode
 
PDF
Summer training report on java se6 technology
Shamsher Ahmed
 
PPTX
Structure programming – Java Programming – Theory
OXUS 20
 
Java Lecture 1
Qualys
 
Java features
myrajendra
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Shravan Sanidhya
 
Core Java
NA
 
Java Programming (M&M)
mafffffe19
 
Industrial Training Report on Java Technology.
Ritesh Kumar Bhanu
 
Java Programming Basics
Rkrishna Mishra
 
Introduction to Java
Professional Guru
 
Java Intro
Nazmul Hasan Rupok
 
Features of java 02
University of Potsdam
 
Industrial Training report on java
Softvision Info Solutions Private Limited
 
Java seminar
devendrakhairwa
 
A Comparison of .NET Framework vs. Java Virtual Machine
Abdelrahman Hosny
 
C,c++,java,php,.net training institute in delhi, best training institute for ...
MCM COmpetitive Classes
 
Programming in Java
Abhilash Nair
 
130700548484460000
Tanzeel Ahmad
 
Java Programming : introduction
Kongu Engineering College, Perundurai, Erode
 
Summer training report on java se6 technology
Shamsher Ahmed
 
Structure programming – Java Programming – Theory
OXUS 20
 

Viewers also liked (20)

PDF
Ozis Pre
ozis_studio
 
ODP
Griffon: Re-imaging Desktop Java Technology
James Williams
 
PDF
Android - 04 - Internship project introduction
Noveo
 
PPT
1 introduction to java technology
rendezvous07
 
PPT
Chapter 1 introduction to java technology
sshhzap
 
PDF
Java 7 - State of the Enterprise
Markus Eisele
 
PDF
Introduction to java technology
Indika Munaweera Kankanamge
 
PDF
Whitep paper on Emerging java and .net technology and critical trends
Rakesh Jha
 
PPTX
1 java programming- introduction
jyoti_lakhani
 
PPT
1 Introduction To Java Technology
dM Technologies
 
PPTX
Introduction to Java Programming
Pokequesthero
 
PDF
Java Technology Trends
Software Park Thailand
 
PPT
Introduction to-programming
BG Java EE Course
 
PPTX
Presentation On Android OS
Akshay Kakkar
 
PPTX
What is Android OS in ppt ?
SoonTips.com
 
PPTX
Android OS Presentation
hession25819
 
PPT
Java basic
Sonam Sharma
 
PPTX
My presentation on Android in my college
Sneha Lata
 
PPT
Core java slides
Abhilash Nair
 
PPT
Android seminar-presentation
connectshilpa
 
Ozis Pre
ozis_studio
 
Griffon: Re-imaging Desktop Java Technology
James Williams
 
Android - 04 - Internship project introduction
Noveo
 
1 introduction to java technology
rendezvous07
 
Chapter 1 introduction to java technology
sshhzap
 
Java 7 - State of the Enterprise
Markus Eisele
 
Introduction to java technology
Indika Munaweera Kankanamge
 
Whitep paper on Emerging java and .net technology and critical trends
Rakesh Jha
 
1 java programming- introduction
jyoti_lakhani
 
1 Introduction To Java Technology
dM Technologies
 
Introduction to Java Programming
Pokequesthero
 
Java Technology Trends
Software Park Thailand
 
Introduction to-programming
BG Java EE Course
 
Presentation On Android OS
Akshay Kakkar
 
What is Android OS in ppt ?
SoonTips.com
 
Android OS Presentation
hession25819
 
Java basic
Sonam Sharma
 
My presentation on Android in my college
Sneha Lata
 
Core java slides
Abhilash Nair
 
Android seminar-presentation
connectshilpa
 
Ad

Similar to An introduction to java programming language forbeginners(java programming tutorials) (20)

DOCX
JAVA First Day
Sher Singh Bardhan
 
PPT
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
PPTX
JAVA Module 1______________________.pptx
Radhika Venkatesh
 
PPTX
java intro.pptx
MangaiyarkarasiDurai
 
PPTX
Introduction to java
Steve Fort
 
PPTX
Introduction to java
Ali Baba
 
PPT
Chapter 1 java
ahmed abugharsa
 
PPTX
Object oriented programming-with_java
Hoang Nguyen
 
PPTX
Object oriented programming
Fraboni Ec
 
PPTX
Object oriented programming-with_java
Tony Nguyen
 
PPTX
Object oriented programming
Luis Goldster
 
PPTX
Object oriented programming-with_java
Harry Potter
 
PPTX
Object oriented programming
Young Alista
 
PPTX
Object oriented programming
James Wong
 
PPT
Servlets and JavaServer Pages (JSP) from the B.Sc. Computer Science and Infor...
RaguV6
 
PPT
Core Java Slides
Vinit Vyas
 
PPTX
Learn java theory presentation
Mark John Lado, MIT
 
PDF
Java Programming
Anjan Mahanta
 
PPT
JAVA object oriented programming (oop).ppt
AliyaJav
 
PPSX
Java Semimar Slide (Cetpa)
Pratima Parida
 
JAVA First Day
Sher Singh Bardhan
 
1.INTRODUCTION TO JAVA_2022 MB.ppt .
happycocoman
 
JAVA Module 1______________________.pptx
Radhika Venkatesh
 
java intro.pptx
MangaiyarkarasiDurai
 
Introduction to java
Steve Fort
 
Introduction to java
Ali Baba
 
Chapter 1 java
ahmed abugharsa
 
Object oriented programming-with_java
Hoang Nguyen
 
Object oriented programming
Fraboni Ec
 
Object oriented programming-with_java
Tony Nguyen
 
Object oriented programming
Luis Goldster
 
Object oriented programming-with_java
Harry Potter
 
Object oriented programming
Young Alista
 
Object oriented programming
James Wong
 
Servlets and JavaServer Pages (JSP) from the B.Sc. Computer Science and Infor...
RaguV6
 
Core Java Slides
Vinit Vyas
 
Learn java theory presentation
Mark John Lado, MIT
 
Java Programming
Anjan Mahanta
 
JAVA object oriented programming (oop).ppt
AliyaJav
 
Java Semimar Slide (Cetpa)
Pratima Parida
 
Ad

More from Daroko blog(www.professionalbloggertricks.com) (20)

DOCX
Small Business ideas you can start in Nigeria 2014(best Business ideas Nigeri...
Daroko blog(www.professionalbloggertricks.com)
 
DOCX
Agriculture business ideas for 2014(Business ideas Kenya,Business ideas Niger...
Daroko blog(www.professionalbloggertricks.com)
 
DOC
An Introduction to Project management(project management tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
java arlow jdbc tutorial(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
The java rogramming swing _tutorial for beinners(java programming language)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
Java programming basics notes for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
advanced java programming(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
java swing tutorial for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
fundamentals of Computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
Computer Graphics display technologies(Computer graphics tutorials and tips)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
Computer Graphics display technologies(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PDF
Displays and color system in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
DOC
Data structures graphics library in computer graphics.
Daroko blog(www.professionalbloggertricks.com)
 
PPT
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
Daroko blog(www.professionalbloggertricks.com)
 
PPT
lecture4 raster details in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
lecture3 color representation in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
lecture2 computer graphics graphics hardware(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
PPT
lecture1 introduction to computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Small Business ideas you can start in Nigeria 2014(best Business ideas Nigeri...
Daroko blog(www.professionalbloggertricks.com)
 
Agriculture business ideas for 2014(Business ideas Kenya,Business ideas Niger...
Daroko blog(www.professionalbloggertricks.com)
 
An Introduction to Project management(project management tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
java arlow jdbc tutorial(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
The java rogramming swing _tutorial for beinners(java programming language)
Daroko blog(www.professionalbloggertricks.com)
 
Java programming basics notes for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
advanced java programming(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
java swing tutorial for beginners(java programming tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
fundamentals of Computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
bresenham circles and polygons in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Computer Graphics display technologies(Computer graphics tutorials and tips)
Daroko blog(www.professionalbloggertricks.com)
 
Computer Graphics display technologies(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Displays and color system in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
Data structures graphics library in computer graphics.
Daroko blog(www.professionalbloggertricks.com)
 
Csc406 lecture7 device independence and normalization in Computer graphics(Co...
Daroko blog(www.professionalbloggertricks.com)
 
lecture4 raster details in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
lecture3 color representation in computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
lecture2 computer graphics graphics hardware(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 
lecture1 introduction to computer graphics(Computer graphics tutorials)
Daroko blog(www.professionalbloggertricks.com)
 

Recently uploaded (20)

PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
infertility, types,causes, impact, and management
Ritu480198
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PPTX
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Governor Josh Stein letter to NC delegation of U.S. House
Mebane Rash
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
infertility, types,causes, impact, and management
Ritu480198
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
AI-Powered-Visual-Storytelling-for-Nonprofits.pdf
TechSoup
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Week 2 - Irish Natural Heritage Powerpoint.pdf
swainealan
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Nitrogen rule, ring rule, mc lafferty.pptx
nbisen2001
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 

An introduction to java programming language forbeginners(java programming tutorials)

Editor's Notes

  • #5: two step process!
  • #7: the interpreter is called the JRE
  • #8: much easier to standardize the interpreter, this is a piece of software that Sun releases for different platforms and programmers do not have to worry about the specifics of the machines they are targeting or distributing multiple machine codes. Can have a single compiled program (bytecode) run on anything there is an interpreter for. For example, a website with java code does not have to worry about the specific machine that is being used by the viewer. It is up to the user to get the interpreter.
  • #11: very important to think about the problem and solution and create a design document… program is not static! it is always evolving. must make the code as understandable as possible, to yourselves and to others… very important that code is well designed