Java中的boolean怎么用?

2025-04-13 12:05:50
推荐回答(1个)
回答(1):

public class Test{
public static void main(String []args){
boolean b = true;
if(b){//b为true
b = false;
System.out.println("b is true");
}
if(!b){//!b为true
System.out.println("b is false now");
}
}}