Skip to content

Commit 8e1e98d

Browse files
add BooleanDemo
1 parent accf145 commit 8e1e98d

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package ABasic.A6Boolean;
2+
3+
public class BooleanDemo {
4+
5+
public static void main(String[] args) {
6+
boolean bool=test();
7+
// bool被装箱为Boolean
8+
if(Boolean.TRUE.equals(bool)){
9+
System.out.println("true");
10+
}else{
11+
System.out.println("false");
12+
}
13+
if(bool){
14+
System.out.println("true");
15+
}
16+
}
17+
18+
public static boolean test(){
19+
return true;
20+
}
21+
22+
}

0 commit comments

Comments
 (0)