2. History
● Most of the character of Java is inherited from two languages. From
C, Java derives its syntax. Many of Java’s Object - Oriented features
were influenced by C++.
● Java was started as a project by James Gosling, Patrick Naughton,
Chris Warth, Ed Frank and Mike Sheridan at Sun Microsystems, Inc.
in 1991.
● This language was initially called “Oak”, but was renamed as “Java”
in 1995.
5. JVM (Java Virtual Machine)
Bytecodes are the machine language of the Java virtual machine.
JVM (Java Virtual Machine) is an abstract machine.
It is a specification that provides runtime environment in which java
bytecode can be executed.
6. JDK (Java Development Kit)
The Java Development Kit (JDK) is a software development
environment used for developing Java applications and applets.
It includes the Java Runtime Environment (JRE), an interpreter/loader
(java), a compiler (javac), an archiver (jar), a documentation generator
(javadoc) and other tools needed in Java development.
7. JRE (Java Runtime Environment)
The Java Runtime Environment (JRE), also known as Java Runtime, is
part of the Java Development Kit (JDK), a set of programming tools for
developing Java applications.
The Java Runtime Environment provides the minimum requirements for
executing a Java application; it consists of the Java Virtual Machine
(JVM), core classes, and supporting files.
8. First Hello World Program
HelloWorld.java
public class HelloWorld {
public static void main(String args[]) {
System.out.println(“Hello World Java Program”);
}
}
9. Compile And Execute
● Set JAVA path and classpath
● Compile
javac HelloWorld.java
java HelloWorld
10. Java - Decision Making
The if Statement
Syntax :
if(condition)
Statement;
else
Statement;
Example :
if (num < 100)
System.out.println(“Number is less than 100”);
else
System.out.println(“Number is greater than 100”)
11. Java - Loop Control
The For Loop
for (initialization; condition; iteration)
statement;
Example :
int x;
for (x = 0; x < 10; x = x + 1) {
System.out.println(“Current Value of X: ” + x);
}