Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28f039a

Browse files
committed
add failing test for class variables with no initial value
1 parent 1d3c3f9 commit 28f039a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/BasicTypes3.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Vector {}
2+
3+
class BasicTypes3 {
4+
Boolean B;
5+
Integer I;
6+
Double D;
7+
8+
String S;
9+
Vector V;
10+
11+
public static void main(String[] args) {
12+
BasicTypes3 bt3 = new BasicTypes3();
13+
System.out.println(bt3.B == null ? 1 : 0);
14+
System.out.println(bt3.I == null ? 1 : 0);
15+
System.out.println(bt3.D == null ? 1 : 0);
16+
System.out.println(bt3.S == null ? 1 : 0);
17+
System.out.println(bt3.V == null ? 1 : 0);
18+
}
19+
20+
}

0 commit comments

Comments
 (0)