Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions 6. Variables/Variables.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class Variables {
public static void main (){
int n1 = 5; //this is a number without a decimal points
double n2 = 5.0 ; // this is number with decimal points
long n3 = 5; // int with more range
short n4 = 5; //int with low range
byte n5 = 5; //short with even lower range
float n6= 5.0f; //double with lower range

System.out.println("Printing int varialbe: "+n1);
System.out.println("Printing double variable "+n2);

boolean x = true; // if the value is true or false use boolean

System.out.println("Printing boolean varialbe"+x);
String y = "Test String";
System.out.println("This is a test String "+y);

}
}