int x=9; if(x>8 and x<10) System.out.println("true"); 以上语句运行的结果是显示true。
举一反三
- 下列程序段: Int x=10,y=8; boolean b=true; System.out.println(x>0&&x<y||b); 的结果为 ( ) A: true B: false C: 1 D: 0
- 阅读下面的程序,下面说法中正确的是() public class Test{ public static int x = 10; public static int y = 20; public static void main(String[] args){ public int x = 100; public boolean b = true; System.out.println("x = "+x); System.out.println("b = "+b); System.out.println("y = "+y); } } A: 变量y是局部变量,b是成员变量。 B: 不能输出y的值,这个程序运行后输出的结果是 x=10 b=true C: 这个程序运行后输出的结果是 x=10 b=true y=20 D: 这个程序运行后输出的结果是 x=100 b=true y=20
- 下面boolean x = false; System.out.println((3>;5) && (x=5>;3)); System.out.println(x);运行结果是 A: true B: false C: 0 D: 1
- 若有定义:int a=2, b=4; boolean x;则执行语句x= a>b; System.out.println(x);的结果为( )。 A: 1 B: 0 C: true D: false
- x=True y=False print("x or y = ", x or y) 运行结果是哪个() A: x or y =True B: x or y =False C: x or y = True D: x or y=False