河南成教 / 河南理工大学
15[分析题]
分析下面程序,写出程序执行结果;
public class Testp {
public static void test(boolean test) {
test = ! test;
System.out.println("In test(boolean) : test = " test);
}
public static void main(String[] args) {
boolean test = true;
System.out.println("Before test(boolean) : test = " test);
test(test);
System.out.println("After test(boolean) : test = " test);
}
}
15[分析题]
分析下面程序,写出程序执行结果;
public class Testp {
public static void test(boolean test) {
test = ! test;
System.out.println("In test(boolean) : test = " test);
}
public static void main(String[] args) {
boolean test = true;
System.out.println("Before test(boolean) : test = " test);
test(test);
System.out.println("After test(boolean) : test = " test);
}
}
参考答案:
佳题速递: