forked from joharbatta/DataStructure-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemo1.java
More file actions
18 lines (18 loc) · 404 Bytes
/
Demo1.java
File metadata and controls
18 lines (18 loc) · 404 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//local variables cannot be used without intialization.
//data types
public class Demo1{
public static void main(String args[])
{
int x=10;
System.out.println(x);
byte y=127;
System.out.println(y);
//by default java treats float as double
double z=12.4;
System.out.println(z);
float a=2.7f;
System.out.println(a);
double s=0.0d;
System.out.println(s);
}
}