-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoVariables.java
More file actions
26 lines (21 loc) · 861 Bytes
/
DemoVariables.java
File metadata and controls
26 lines (21 loc) · 861 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
class DemoVariables{
public static void main(String args[]){
//primitive data types
//Integer Type
byte sb = 90; //8 bit, same as Int
short s = -355; //16 bit,same as Int
int a = 34; //32 bit, Integer values postitive or negative
long l = 9_00_00_00_00_00_000L; //64 bit, L is used or treated as Int by Compiler
//Non-integer type
boolean b = false; //8 bit, either true or false
char c = '&'; //16 bit, can take anything within '' quotes.
//Decimal Values
float e = 5.67F; //32 bit, F is used at end or treated as Double
double d = 9.75; //64 bit, Decimal values
System.out.println( a + " Concatenating the statements " + l );
kane();
}
public static void kane(){
System.out.println("This is Kane williamson");
}
}