0% found this document useful (0 votes)
31 views3 pages

Chapter 1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

DPJ 5018 – Programming in Java Chapter 1

Chapter 1: INTRODUCTION TO JAVA ENVIRONMENTS

History of Java

• Developed by a team led by James Gosling at Sun Microsystems.


• Originally called “OAK”, it was designed in 1991 for use in embedded consumer
electronic applications.
• In 1995, renamed “JAVA”, it was designed for developing Internet applications.
• Can be embedded in HTML pages and downloaded by Web browsers to bring live
animation and interaction to Web clients.
• Not limited to web applications, can be used to develop standalone applications
• Java is inherently object-oriented.
• You want to know more? Read “Java Technology: An Early History – 1998”
(http://www.imamu.edu.sa/dcontent/IT_Topics/java/javahistory.pdf)

Characteristics of Java
• Simple
• Object-Oriented
• Distributed
• Interpreted
• Robust
• Secure
• Architecture-Neutral
READ! :
• Portable
Java Characteristics
• High Performance
(http://www.cs.armstrong.edu/liang/intro6e/JavaCharacteris
• Multithreaded
tics.pdf)
• Dynamic

Types of Java

• Java Application
o Is a standalone programs.
o Can be executed from any computer with a Java interpreter

• Java Applet
o Is special kind of Java Programs that can run directly from Java-compatible Web
browser. (Will be introduced in Chapter 10)

JAVASCRIPT IS NOT JAVA. (http://www.w3schools.com/js/js_intro.asp)

WHAT IS JSP? WHAT IS GROOVY?

Java Environments

• Language Specification

- Computer languages have strictly rules of usage. The Computer will be unable to
understand it if you do not follow the rules when writing the program

CDP Page 1 of 3 as/5018/Tri51


DPJ 5018 – Programming in Java Chapter 1

- The Java languages specification is a technical definition of the language that


includes syntax, constructs and the application program interface (API), which
contains predefined classes. (http://docs.oracle.com/javase/6/docs/api/)

• Development Tools

- Oracle (**SUN acquisition by Oracle) releases each version of Java with a Java
Development Kit (JDK) or Software Development Kit (SDK).
- It is a primitive command-line tool set that includes software libraries, a
compiler, an interpreter for running, and an applet viewer for testing applets,
as well as other useful utilities.

- There are three editions of Java:

 Java Standard Edition (Java SE)


• Provides all the essential software tools necessary for
writing Java applications and applets.
• This subject is based on Java SE framework.
• The recent version is JDK 7. However, JDK 6 will be used for
the lab session.

 Java Enterprise Edition (Java EE)


• Provides tools for creating large business applications that
employ servers and provide services over the Web.

 Java Micro Edition (Java ME)


• Provides a small, highly optimized runtime environment for
consumer products such as cell-phones, pagers and appliances.

- Integrated Development Environments (IDE) / Java Development Package

 Besides JDK, there are many Java IDE or development packages on the
market today.
 These environments consist of a text editor, compiler, debugger and
other utilities integrated into a package with a single set of menu.

 Some of the popular IDE / package:


• Eclipse (http://www.eclipse.org/)
• Netbeans (http://netbeans.org/) --> is used in the lab session
• JBuilder by Borland (http://www.borland.com/jbuilder)
• jEdit (http://www.jedit.org/)
• JCreator (http://www.jcreator.com/)  is used in lab session (updates
--------------------------- 2013 -
no more free
version)

CDP Page 2 of 3 as/5018/Tri51


DPJ 5018 – Programming in Java Chapter 1

• Creating, Compiling and Executing a Java Program

The creation of a Java program generally follows the steps below.

Create/Modify Source code

.java File

Compile Source code

. class File (Byte codes)

Run Byte code (interpreter)


Java Virtual Machine (JVM)

HOW

 You have to create your program and compile it before it can be executed.
 You have to save the Java source code as java extension ( .java ).
 The file name must same as the class name.
 Then you compile it. If your program has error(s), the error has to be
corrected before the compiler can translate the source code.
 The compiling process is to translate the Java source code to Java byte code
and generates the dot class (.class ) file.
 To execute a Java program is to run the program’s byte code.
 Byte code instructions are NOT machine language and therefore cannot be
directly executed by the CPU.
 The Java Virtual Machine (JVM) executes the byte code instructions.
 JVM is a program that simulates a computer whose language is Java byte
code.

CDP Page 3 of 3 as/5018/Tri51

You might also like