0% found this document useful (0 votes)
12 views12 pages

Javaliciousness

Uploaded by

misskonasiandre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

Javaliciousness

Uploaded by

misskonasiandre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

UNIT 2

Java Basics

CC 103Computer Programming 1
LESSON Overview of Java
1 Language

CC 103Computer Programming 1
LESSON
1 Java Programming Language

It is an object-oriented programming language


originally developed by Sun Microsystems and
released in 1995 as a core component of Sun
Microsystems' Java platform. The language derives
much of its syntax from C and C++ but has a simpler
object model and fewer low-level facilities.

CC 103Computer Programming 1
LESSON
1 Kinds of Java Programs

Application – it is a regular program meant to be run


on your computer.

Applet – it is a little program meant to be run on the


internet. They programs that are embedded in other
applications, typically in a Web page displayed in a
Web browser.

CC 103Computer Programming 1
LESSON
1 Java Program Execution
Compiling the program – use a Just-in-Time (JIT) compiler to
translate the Java program into byte-code.

Running the program – use the bytecode interpreter to translate


each bytecode instruction to machine language and to run the
machine language instruction

CC 103Computer Programming 1
LESSON
1 Java Program Execution
Java Byte-Code

It is a machine language for a hypothetical computer called Java


Virtual Machine (JVM).

It is a kind of object code generated by a Java compiler and


interpreted by a Java Virtual Machine.

It is platform independent.

Interpreter
It is used to translate byte-code to machine language.
CC 103Computer Programming 1
LESSON
1 Java Program Execution

Java Virtual Machine


It is a software tool that behaves like a high-level computer.

It executes Java bytecode programs.

It executes compiled Java programs regardless of the hardware or


software platform it is installed on.

The Java virtual machine knows nothing of the Java programming


language, only of a particular binary format, the class file format. A class
file contains Java virtual machine instructions (or bytecodes) and a symbol
table, as well as other additional information.
CC 103Computer Programming 1
LESSON
1 Phases in Processing a Java Program
Editor
1 Creating a Program (Edit)

2 Compiling a Java Program(Compile) Compiler

3 Loading a Program into Class


Memory(Load) Loader

4 Bytecode Verification(Verify) Bytecode


Verifier

5 Execute the Program(Execute)


Java Virtual Machine(JVM)
CC 103Computer Programming 1
LESSON
1 Phases in Processing a Java Program
Use a text editor to create a program , this program is called
1 the source program. The program must be saved in a file
named <ClassName>.java, where ClassName is the name of
the Java class contained in the file.
An integrated development environment (IDE) is a
programming environment that has been packaged as an
application program, typically consisting of a code editor, a
compiler, a debugger, and a graphical user interface (GUI)
builder. The IDE may be a standalone application or may be
included as part of one or more existing and compatible
applications.
CC 103Computer Programming 1
LESSON
1 Phases in Processing a Java Program

You use the command javac(the Java compiler) to compile a


2
program. For example, you’d type

javac Welcome.java
in the command window of your system( the command
prompt in Windows).
The compiler checks the source program for syntax errors,
and if no error is found, translates the program into
bytecode. The bytecode is saved in the file with the .class
extension that represent the tasks to execute in the
execution phase.
CC 103Computer Programming 1
LESSON
1 Phases in Processing a Java Program

3 To run the program, the .class file must be loaded into


computer memory done by the program known as the
class loader, the bytecode for classes used in the
program must be connected.

CC 103Computer Programming 1
LESSON
1 Phases in Processing a Java Program

As the classes are loaded into main memory, the bytecode


4
verifier verifies that the bytecode for the classes is valid.

CC 103Computer Programming 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy