0% found this document useful (0 votes)
132 views

Lesson 2 - Introduction To Java

This document provides an overview of the Java Programming NCIII course, including its code, title, and prerequisites. It covers topics such as the history of Java, bytecode, classloaders, applets, features of Java, and how the Java Development Kit and Java Virtual Machine work.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

Lesson 2 - Introduction To Java

This document provides an overview of the Java Programming NCIII course, including its code, title, and prerequisites. It covers topics such as the history of Java, bytecode, classloaders, applets, features of Java, and how the Java Development Kit and Java Virtual Machine work.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Course Code : CP1212

Course Title : Java Programming NCIII

Pre-Requisites : N/A
Introduction to
Java
Programming
Java Programming Brief History
Java PL developed in 1991.
SUN MICROSYSTEM – Stanford University Network
James Arthur Gosling – He is the founder and lead
designer behind the Java programming language.
Green – Code Name of Java PL
From OAK Programming Language to Java PL.
1994 - Web browsers and Java's connection to the
internet began.
1995 – Java 1.0 was Released
April 2009 - Oracle Corporation acquire Sun for US$7.4
billion.
bytecode – Compiled format for java programs
where it can be transferred across a network
executed by Java Virtual Machine (JVM)
class loader – Part of Java Runtime Environment
that dynamically loads java classes into JVM
usually, classes are only loaded on demand.
source code – Programming commands that are
made by a programmer with a text editor and
then saved in file.
Java Applet Basics

Applet is a Java program that can be


embedded into a web page.
It runs inside the web browser and works at
client side.
Applet is embedded in a HTML page using the
APPLET or OBJECT tag and hosted on a web
server.
Reference: https://www.geeksforgeeks.org/java-applet-basics/
Using java enabled web browser : To execute an
applet in a web browser we have to write a short
HTML text file that contains a tag that loads the
applet.

<applet code="HelloWorld" width=200


height=60>
</applet>
Using appletviewer : This is the easiest way to run
an applet. To execute HelloWorld with an applet
viewer, you may also execute the HTML file shown
earlier.
a. Object Oriented – is an OOP programming
language. Everything in Java is an object. Object-
oriented means we organize our software as a
combination of different types of objects that
incorporates both data and behavior.
b. Dynamic - is a dynamic language. It supports
dynamic loading of classes. It means classes are
loaded on demand. It also supports functions from
its native languages, i.e., C and C++.
c. Multithreaded – A thread is like a separate
program, executing concurrently. We can write
Java programs that deal with many tasks at once
by defining multiple threads.
d. Architectural Neutral - Java is architecture neutral
because there are no implementation dependent
features, for example, the size of primitive types
is fixed.
Reference: https://www.javatpoint.com/features-of-java
Java Development Kit (JDK) Programs
undergo five phases:

Create / Edit, Load,


Verify, and Execute.
Phases

Creating and editing a file using an


editor is done by the programmer.
Save the Program on a storage .java
File extension.

Command is used by the Programmer


to compile a program. Compile type
like Javac Greeting.java
The .class file containing the program’s
bytecodes will be taken by the class
loader and transmits it to memory

Bytecodes are examined by the


bytecode verifier to validate that it does
not defy java restrictions.

Bytecodes stated in the program will be


executed by the JVM. Analyzes the
Bytecode
JVM
is an abstract
computing
machine or
virtual
machine
interface that
drives the
java code.
Reference: https://www.w3schools.in/java-tutorial/java-virtual-machine/
1. It is the phase where programs perform the
actions specified by the programmer
2. It is the phase where program examines their
bytecodes to ensure that they are valid and do
not violate java’s security restrictions
3. It is the phase where program must be placed
in memory before it can execute a process
4. It is the phase where it translates the java
source code into bytecodes that present the
tasks to be performed.
5. It is the phase layer where you type a java
program typically referred to a source code)
using the editor, make a necessary corrections
and save the program to a secondary storage
device
6. It is the abstract computing machine or
virtual machine interface that drives the java
code.
7. It is the java program that can be
embedded into a web page.
8. Programming commands that are made by a
programmer with a text.
9.Part of Java Runtime Environment that
dynamically loads java classes into JVM
usually, classes are only loaded on demand.

10. He is the founder and lead designer behind


the Java programming language.
11 – 14. Give At least 4 features of Java
Programming. (4 points)

15 – 20 . Describe how the JVM works.


(6 points)

You might also like