-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.java
More file actions
35 lines (26 loc) · 851 Bytes
/
main.java
File metadata and controls
35 lines (26 loc) · 851 Bytes
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
34
35
public class main{
public static void main(String args[]){
System.out.println("hello world");
String name ="Manya";
int a= 2;
float b= 3.2f;
boolean isAdult= false;
System.out.println(name);
System.out.println(a);
System.out.println(b);
System.out.println(isAdult);
/* rules for naming variables
can contain digits, dollar sign, letters, underscore
should begin with letter, $ or _
java is case sensitive language whcih means manya and Manya are diff variables
should not contain whitespaces
*/
/* two types of data types
1. primitive - byte(1 byte), short(2 bytes), int, long, float, double, char, boolean(1bit)
2. non-primitive/ reference -
*/
byte u= 56;
//byte= 156 ---->error
System.out.println(u);
}
}