Skip to content

Commit 5c5e964

Browse files
Create TypePromotion.java
1 parent e221753 commit 5c5e964

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

TypePromotion.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
public class practice {
2+
3+
public static void main(String[] args) {
4+
5+
byte b=42;
6+
short s=1024;
7+
char c='a';
8+
int i=50000;
9+
float f=5.6f;
10+
double d=.231;
11+
double result=(f*b)+(i/c)-(d*s);
12+
System.out.println((f*b)+"+"+(i/c)+"-"+(d*s));
13+
System.out.println("result="+result);
14+
}
15+
}

0 commit comments

Comments
 (0)