光学不练那可不行,来测一测吧!
需要更多教程,微信扫码即可
题目一:进行Java基本的GUI设计需要用到的包是()
A:java.ioB:java.sqlC:java.awtD:java.rmi
题目二:javac的作用是( )。
A:将源程序编译成字节码B:将字节码编译成源程序C:解释执行Java字节码D:调试Java代码
题目三:下面关于静态方法说明正确的是
A:在静态方法中可用this来调用本类的类方法B:在静态方法中调用本类的静态方法时可直接调用C:在静态方法中只能调用本类中的静态方法D:在静态方法中绝对不能调用实例方法
题目四:设int x=1,float y=2,则表达式x/y的值是:()
A:0B:1C:2D:以上都不是
题目五:类 ABC 定义如下:
1 . public class ABC{
2 . public double max( double a, double b) { }
3 .
4 . }
将以下哪个方法插入行 3 是不合法的。()
A:public float max(float a, float b, float c){ return a }B:public double max (double c, double d){ return c }C:public float max(float a, float b){ return a }D:private int max(int a, int b, int c){return a }
题目六:下面程序的输出是:()
| 1 2 3 4 5 | String x="fmn"; x.toUpperCase(); String y=x.replace('f','F'); y=y+"wxy"; System.out.println(y); |
A:FmNwxyB:fmnwxyC:wxyfmnD:Fmnwxy
题目七:下列程序的运行结果
| 1 2 3 4 5 6 7 8 9 10 11 12 | public static void main(String args[]) { Thread t = new Thread() { public void run() { pong(); } }; t.run(); System.out.print("ping"); } static void pong() { System.out.print("pong"); } |
A:pingpongB:pongpingC:pingpong和pongping都有可能D:都不输出
题目八:有以下类定义:
| 1 2 3 4 5 6 7 8 9 10 11 | abstract class Animal{ abstract void say(); } public class Cat extends Animal{ public Cat(){ System.out.printf("I am a cat"); } public static void main(String[] args) { Cat cat=new Cat(); } } |
运行后:
A:I am a catB:Animal能编译,Cat不能编译C:Animal不能编译,Cat能编译D:编译能通过,但是没有输出结果
都做出来了吗?答案详解以及相关学习资料扫码即可哦。
文末福利
需要更多教程,微信扫码即可
别忘了扫码领取资料哦
【高清Java学习线路图】和【全套学习视频及相关资料】



