Skip to content

Commit 6c535fe

Browse files
committed
test for fixing String + double/float/Double/Float
1 parent 1475faa commit 6c535fe

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package test;
2+
3+
class Test_Double {
4+
5+
public static void main(String[] args) {
6+
System.out.println(("" + new Double(3)).equals("3.0"));
7+
System.out.println(("" + new Float(3)).equals("3.0"));
8+
System.out.println(("" + new Double(3) * 3).equals("9.0"));
9+
float x = 3;
10+
float y = 3;
11+
int i = 3;
12+
System.out.println(("" + x).equals("3.0"));
13+
System.out.println(("" + y).equals("3.0"));
14+
System.out.println(("" + x * y).equals("9.0"));
15+
System.out.println(("" + (y + 0)).equals("3.0"));
16+
System.out.println(("" + (i + 0.0)).equals("3.0"));
17+
System.out.println(("" + Math.round(y)).equals("3"));
18+
}
19+
20+
}

0 commit comments

Comments
 (0)