Skip to content

Commit 7c2b2fc

Browse files
committed
basics
1 parent e8849b9 commit 7c2b2fc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎java basic/src/basic/Numbers.java‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ public class Numbers {
88
static int intMax2 = Integer.MAX_VALUE;
99
static int intMin2 = Integer.MIN_VALUE;
1010
static long longNum = 1_000_000_000_000L; /* L is mandatory*/
11-
float pi = 3.141f; /* similarly, f */
11+
float pi = 3.141f;
1212
/*If f is not specified,
1313
Err: incompatible types: possible lossy conversion from double to float*/
1414
double piValue = 3.1415;
15+
double pivalue2 = 3.1d;
1516

17+
static void Q(){
18+
/* casting */
19+
float f = (float) 20d + 20.02f;
20+
long n = 10 + 2L;
21+
byte b = (byte) (n + 5);
22+
}
1623

1724
public static void main(String[] args) {
1825
System.out.println(intMax2);

0 commit comments

Comments
 (0)