-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile1.java
33 lines (29 loc) · 974 Bytes
/
file1.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class file1 {
// The name of the class should be same as the name of the class
public static void main(String args[]){
System.out.println("Hello world");
}
}
// The template for saving a particular file remians the same
// How is my code running ??
/*
i) Compilation:
Whatever we wrote is called source code(with the extension.java) and it goes to compiler in JDK and it is converted into byte
code with the extension .class and this byte code can be ran on any operating system as long as the
operating system has JRE which is Java Run time environment due to which it is very portable
ii) Execution:
The byte code which we got JVM gets it and converts it into native code
Components of program:
1. Function:
void main(){
}
2. Class:
Class main{
void main(){
}
}
System.out.print("Hello world");
where system is a class and in java the line ends with semi colon
and you can use single quotes as well
*
*/