Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created the variable class #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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);

}
}