以下代码输出结果为:public class IfTest{ public static void main(String[] args){ int x=3; int y=1; if(x=y) System.out.println("不相等"); else System.out.println("相等"); }}
(A)不相等
(B)相等
(C)第五行代码会引起编译错误
(D)程序正常执行,但没有输出结果
参考答案
继续答题:下一题


更多java基础知识试题
- 1声明一个数组 :int [] ar = {1,2,3,4,5};
- 2下面哪个函数是public void example(){...}的重载函数( )
- 3下列关于JDK的说法中,错误的是?( )
- 4下列哪个类声明语句是正确的( )
- 5以下代码输出结果为:public class Main { public static void main(String args[]) { String x = null; giveMeAString(x); System.out.println(x); } static void giveMeAString(String y) { y = "RUNOOB"; } }