2.1 Java Installation
2.1 Java Installation
2.1 Java Installation
Java
By Upekha Vandebona
Alternative OO Programming
Languages
Using Java
Lightweight IDEs
online/offline
Command Prompt
&
Notepad
Workbench
IDEs
Download & Install Java JDK
If you cannot see the version, the reason is PATH
not set.
If you use an installer to install java, it will
automatically set the path environment variable.
Installer will automatically
set this path for Java in
environment variables.
Setting the path of Java in the
computer temporarily
When the JVM starts running, it looks for the class you give
it at the command line.
Then it starts looking for a specially-written method that
looks exactly like:
Next, the JVM runs everything between the curly braces {} of your main
method.
“Hello World” Driver
Program
1.Save
• MyFirstApp.java
2.Compile
• javac MyFirstApp.java
3.Run
• Java MyFirstApp
Main Method
Once you're inside main method,
you can say all the normal things
that you say in most programming
languages to make the computer to
do something.
do something again and again
do something under a condition
Java -Few Basic Rules
Each statement must end in a semicolon.
x = x + 1;
Most white space doesn't matter.
x = 3 ;
Classes and methods must be defined within a pair of
curly braces.
public void go() {
// amazing code here
}
Filename should be exactly same as the class name
which main method reside.
Java is case-sensitive.
‘println’Vs ‘print’
Hello!
Good Morning!
n A rro w
se U p / D ow
U u se
t h e re Make new directory/folder
keys m a n d s
v i o u s c om
pre
sily
Few Useful DOS Commands