光学不练那可不行,来测一测吧!
需要更多教程,微信扫码即可
题目一:java中,用( )关键字定义常量?
A:finalB:#defineC:floatD:const
题目二:下列哪个类的声明是正确的?
A:abstract final class HI{}B:abstract private move(){}C:protected private number;D:public abstract class Car{}
题目三:下列程序段的输出结果是:( )
| 1 2 3 4 5 6 | public void complicatedexpression_r(){ int x=20, y=30; boolean b; b = x > 50 && y > 60 || x > 50 && y < -60 || x < -50 && y > 60 || x < -50 && y < -60; System.out.println(b); } |
A:trueB:falseC:1D:0
题目四:对抽象类的描述正确的是()
A:抽象类的方法都是抽象方法B:一个类可以继承多个抽象类C:抽象类不能有构造方法D:抽象类不能被实例化
题目五:哪个关键字可以对对象加互斥锁?()
A:synchronizedB:volatileC:serializeD:static
题目六:以下代码执行后输出结果为( )
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | public class Test { public static void main(String[] args) { System.out.println("return value of getValue(): " + getValue()); } public static int getValue() { try { return 0; } finally { return 1; } } } |
A:return value of getValue(): 1B:return value of getValue(): 0C:return value of getValue(): 0return value of getValue(): 1D:return value of getValue(): 1return value of getValue(): 0
题目七:有如下一段程序:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | public class Test{ private static int i=1; public int getNext(){ return i++; } public static void main(String [] args){ Test test=new Test(); Test testObject=new Test(); test.getNext(); testObject.getNext(); System.out.println(testObject.getNext()); } } |
请问最后打印出来的是什么?()
A:2B:3C:4D:5
题目八:关键字super的作用是?
A:用来访问父类被隐藏的非私有成员变量B:用来调用父类中被重写的方法C:用来调用父类的构造函数D:以上都是
都做出来了吗?答案详解以及相关学习资料扫码即可哦。
文末福利
需要更多教程,微信扫码即可
别忘了扫码领取资料哦
【高清Java学习线路图】和【全套学习视频及相关资料】



