![Page 1: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/1.jpg)
1Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Introduction to Java
![Page 2: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/2.jpg)
2Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Programs
Computer programs, known as software, are instructions to the computer.
You tell a computer what to do through programs.
Programs are written using programming languages.
![Page 3: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/3.jpg)
3Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Programming LanguagesMachine Language Assembly Language High-Level Language
1101101010011010
Computers can run instructions only in machine language!
Machine language is machine-dependent and one machine code designed for a computer system might not run in another computer.
![Page 4: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/4.jpg)
4Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Programming LanguagesMachine Language Assembly Language High-Level Language
Humans are not comfortable with machine languages, so they made low-level languages like Assembly.
ADDF3 R1, R2, R3
… ADDF3 R1, R2, R3 …
Assembly Source File
Assembler
… 1101101010011010 …
Machine Code File
![Page 5: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/5.jpg)
5Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Programming LanguagesMachine Language Assembly Language High-Level Language
Then high-level languages were invented which are English-like and easy to learn and program.
Sum = 4 + 5;
Area = 5 * 5 * 3.1415;
![Page 6: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/6.jpg)
6Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Popular High-Level Languages
Language Description
Ada
BASIC
C
C++
C#
COBOL
FORTRAN
Java
Pascal
Python
Visual Basic
Named for Ada Lovelace, who worked on mechanical general-purpose computers. The Ada language was developed for the Department of Defense and is used mainly in defense projects.
Beginner’s All-purpose Symbolic Instruction Code. It was designed to be learned and used easily by beginners.
Developed at Bell Laboratories. C combines the power of an assembly language with the ease of use and portability of a high-level language.
C++ is an object-oriented language, based on C.
Pronounced “C Sharp.” It is a hybrid of Java and C++ and was developed by Microsoft.
COmmon Business Oriented Language. Used for business applications.
FORmula TRANslation. Popular for scientific and mathematical applications.
Developed by Sun Microsystems, now part of Oracle. It is widely used for developing platform-independent Internet applications.
Named for Blaise Pascal, who pioneered calculating machines in the seventeenth century. It is a simple, structured, general-purpose language primarily for teaching programming.
A simple general-purpose scripting language good for writing short programs.
Visual Basic was developed by Microsoft and it enables the programmers to rapidly develop graphical user interfaces.
![Page 7: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/7.jpg)
7Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Interpreting/Compiling Source Code
A program written in a high-level language is called a source program or source code.
Source Code → Machine Code (Or Virtual Machine Code) → Execute
The translation can be done using another programming tool called an interpreter or a compiler.
![Page 8: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/8.jpg)
8Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Interpreting Source CodeAn interpreter reads one statement from the source code, translates it to the machine code or virtual machine code, and then executes it right away.
… area = 5 * 5 * 3.1415; ...
High-level Source File
Interpreter Output
![Page 9: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/9.jpg)
9Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Compiling Source CodeA compiler translates the entire source code into a machine-code file, and the machine-code file is then executed, as shown in the following figure.
… area = 5 * 5 * 3.1415; ...
High-level Source File
Compiler Executor Output …
0101100011011100 1111100011000100 … ...
Machine-code File
![Page 10: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/10.jpg)
10Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
A Simple Java Program
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
![Page 11: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/11.jpg)
11Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Creating and Editing Using geditTo use , type
gedit Welcome.java from the terminal.
![Page 12: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/12.jpg)
12Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
javac Welcome.java
Compiling Java program
javac is the java compiler It translates Java source code to java bytecode (a type of virtual machine code)
![Page 13: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/13.jpg)
13Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
java Welcome
Running Java program
Java Virtual Machine is a software that can execute Java bytecode.
![Page 14: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/14.jpg)
14Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Machine Independency
Java Bytecode
Java Virtual Machine
Any Computer
![Page 15: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/15.jpg)
15Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Trace a Program ExecutionEnter main method
![Page 16: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/16.jpg)
16Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Trace a Program ExecutionExecute statement
![Page 17: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/17.jpg)
17Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Trace a Program Execution
print a message to the console
![Page 18: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/18.jpg)
18Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Hierarchy of a Java Program
� A book (program) consists of a number of chapters (classes)
� Each chapter (class) consists of a number of paragraphs (methods)
� Each paragraph (method) consists of a number of sentences (statements)
� Each sentence (statement) must obey the syntax rules in the English (Java) language
![Page 19: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/19.jpg)
19Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Class
Every Java program must have at least one class. Each class has a name. By convention, class names start with an uppercase letter. In this example, the class name is Welcome.
![Page 20: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/20.jpg)
20Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Method
A method contains a set of statements!
In order to run a class, the class must contain a method named main. The program is executed from the main method.
![Page 21: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/21.jpg)
21Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
StatementA statement represents an action or a sequence of actions.
![Page 22: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/22.jpg)
22Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Statement Terminator
Every statement in Java ends with a semicolon (;).
![Page 23: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/23.jpg)
23Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
//This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
Reserved wordsReserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program.
![Page 24: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/24.jpg)
24Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Blocks
A pair of braces in a program forms a block that groups
components of a program.
public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } }
Class block
Method block
![Page 25: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/25.jpg)
25Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Special Symbols
Character Name Description
{}
() [] // " "
;
Opening and closing braces
Opening and closing parentheses
Opening and closing brackets
Double slashes
Opening and closing quotation marks
Semicolon
Denotes a block to enclose statements.
Used with methods.
Denotes an array. Precedes a comment line. Enclosing a string (i.e., sequence of characters).
Marks the end of a statement.
![Page 26: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/26.jpg)
26Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
{ … }
![Page 27: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/27.jpg)
27Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
( … )
![Page 28: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/28.jpg)
28Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
;
![Page 29: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/29.jpg)
29Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
// …
![Page 30: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/30.jpg)
30Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}
" … "
![Page 31: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/31.jpg)
31Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Programming Style and Documentation
� Appropriate Comments� Naming Conventions� Proper Indentation and Spacing
Lines� Block Styles
![Page 32: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/32.jpg)
32Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Appropriate Comments
Include a summary at the beginning of the program to explain what the program does, its key features, its supporting data structures, and any unique techniques it uses.
![Page 33: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/33.jpg)
33Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Naming Conventions
� Choose meaningful and descriptive names.� Class names:
– Capitalize the first letter of each word in the name. For example, the class name ComputeExpression.
![Page 34: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/34.jpg)
34Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Proper Indentation and Spacing
� Indentation– Indent two spaces.
� Spacing – Use blank line to separate segments of the code.
![Page 35: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/35.jpg)
35Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Block Styles
Use end-of-line style for braces.
public class Test { public static void main(String[] args) { System.out.println("Block Styles"); } }
public class Test { public static void main(String[] args) {
System.out.println("Block Styles"); } }
End-of-line style
Next-line style
![Page 36: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/36.jpg)
36Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
API (Application Program Interface)
� - API also known as library contains predefined classes and interfaces for developing Java programs.
![Page 37: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/37.jpg)
37Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
JDK (Java Development Kit)� - The Java Development Kit (JDK) is a software
development environment used for developing Java applications.
� - It includes general purpose APIs, the Java Runtime Environment (JRE)(Which contains JVM), an executer/launcher (java), a compiler (javac), an archiver (jar), a documentation generator (javadoc) and other tools needed in Java development.
� - Newest Version:
JDK 1.7 (2011) a. k. a. JDK 7 or Java 7
![Page 38: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/38.jpg)
38Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
JDK Editions� Java Standard Edition (J2SE)
– J2SE can be used to develop client-side standalone applications or applets.
� Java Enterprise Edition (J2EE)– J2EE can be used to develop server-side applications
such as Java servlets, Java ServerPages, and Java ServerFaces.
� Java Micro Edition (J2ME). – J2ME can be used to develop applications for mobile
devices such as cell phones.
![Page 39: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/39.jpg)
39Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
IDE (Integrated Development Environment)
� - IDE is a software for rapidly developing programs.
� Some famous IDEs for Java:– Eclipse (Free, open-source IDE)– NetBeans (Free, open-source IDE)– Borland JBuilder
![Page 40: Chapter 1 Introduction to Java - Emory Universitylpourna/fall13/cs170/lectures/... · 2013-09-09 · Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education,](https://reader034.vdocument.in/reader034/viewer/2022050410/5f87057030a55e1d92018855/html5/thumbnails/40.jpg)
40Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.
Text Editors
� For java programming, we can use either simple text editors like gedit, notepad, textpad or an advanced IDE.
� It is better to start with editors.