Professional Documents
Culture Documents
CSN-103: Fundamentals of Object Oriented Programming: Indian Institute of Technology Roorkee
CSN-103: Fundamentals of Object Oriented Programming: Indian Institute of Technology Roorkee
CSN-103: Fundamentals of Object Oriented Programming: Indian Institute of Technology Roorkee
2
Java Bytecode
3
Java Bytecode
4
Compiling and Running Java Program
Java Java
Compiler Interpreter
5
JVM vs. JRE vs. JDK
6
JVM vs. JRE vs. JDK
JDK
JRE
JVM
+ Libraries
+ Development Tools
7
Java Prerequisites
8
Setting Up Java
9
Downloading Java
10
Installing Java (Windows)
• Once the file is downloaded successfully, double-click on the saved file to start the installation process
• Click the Next button to continue with the installation
11
Set the Path (Windows)
12
Set the Path (Windows)
Variable Value:
C:\Program Files\Java\jdk-12.0.2\bin
13
Verify Java
14
A Simple Java Program
class Example
{
public static void main(String args[])
{
System.out.println("This is a simple Java program");
}
/* This is a comment
The comment contains multiple lines */
}
15
Things to remember
16
Compiling the Program
18
Single-File Source-Code Programs
C:\>java Example.java
19
Compiling and Running Java Program
Java Java
Compiler Interpreter
<file>.java <file>.class
20