每日10道JAVA题(20180704)

89 篇文章 2 订阅

/ **   
 * 10道题系列会持续更新,每日的10道题都是我做过的,做错或者觉得需要复习的有价值的
 *请关注我,每日和我一同进步,有更好的建议或有问题的请在评论区提出或私信我

 * /

1.设有下面两个赋值语句:

a = Integer.parseInt("1024");
b = Integer.valueOf("1024").intValue();

下述说法正确的是()
A.a是整数类型变量,b是整数类对象。
B.a是整数类对象,b是整数类型变量。
C.a和b都是整数类对象并且它们的值相等。
D.a和b都是整数类型变量并且它们的值相等。


2.Java的跨平台特性是指它的源代码可以在多个平台运行。

A.对
B.错

3.下面哪个行为被打断不会导致InterruptedException:( )?

A.Thread.join
B.Thread.sleep
C.Object.wait
D.CyclicBarrier.await
E.Thread.suspend

4.下列有关Thread的描述,哪个是正确的?

A.启动一个线程的方法是:thread. run()
B.结束一个线程的通常做法是:thread. stop()
C.将一个线程标记成daemon线程,意味着当主线程结束,并且没有其它正在运行的非daemon线程时,该daemon线程也会自动结束。
D.让一个线程等待另一个线程的通知的方法是:thread. sleep()

5.public class contained in a Java program file must have the same name as the file, except for the extension ".java".

A.FALSE
B.TRUE

6.以下声明合法的是

A.default  String  s
B.public  final  static  native  int  w( )
C.abstract  double  d
D.abstract  final  double  hyperbolicCosine( )

7.下面有关java classloader说法正确的是()?

A.ClassLoader就是用来动态加载class文件到内存当中用的
B.JVM在判定两个class是否相同时,只用判断类名相同即可,和类加载器无关
C.ClassLoader使用的是双亲委托模型来搜索类的
D.Java默认提供的三个ClassLoader是Boostrap ClassLoader,Extension ClassLoader,App ClassLoader
E.以上都不正确

8.下列哪个选项是错误的。()

A.一个文件中只能有一个public class。
B.一个文件中可以有多个类。
C.一个类中可以有两个main方法。
D.若类中只含一个main方法,则必须是public的。

9.针对以下代码,哪些选项执行后是true的:()
class CompareReference{
   public static void main(String [] args){
   float f=42.0f;
   float f1[]=new float[2];
   float f2[]=new float[2];
   float[] f3=f1;
   long x=42;
   f1[0]=42.0f;
  }
}

A.f1==f2
B.x==f1[0]
C.f1==f3
D.f2==f1[1]

10.Why would a responsible Java programmer want to use a nested class?
A.To keep the code for a very specialized class in close association with the class it works with.
B.To support a new user interface that generates custom events.
C.To impress the boss with his/her knowledge of Java by using nested classes all over the place.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

StrideBin

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值