-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVariables.java
34 lines (25 loc) · 1.15 KB
/
Variables.java
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
package variables;
//Varibales in java
public class Variables {
public static void main(String[] args) {
byte b=5; //The byte data type in Java is a signed integer based on the two's complement 8-bit mechanism.
short s=300; //The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767
int i=100; //It can hold a 32-bit signed two's complement integer.
float f=25.3f; //A float data type in Java stores a decimal value with 6-7 total digits of precision. ... The default value of a float in Java is 0.0f
char c='A'; //It is capable of holding the unsigned 16-bit Unicode characters.
System.out.println(b);
System.out.println(s);
System.out.println(i);
System.out.println(f);
System.out.println(c);
}
}
//////////////Output/////////////
// 5 //
// 300 //
// 100 //
// 25.3 //
// A //
/////////////////////////////////
//Thanks you
//bye