文章目录
-
-
- abstract
- static
- Thread
- finally
- package
- Exception
- I/O
- 子类和父类
- 关键字
- 标识符
- 垃圾收集
- 数据类型
- 环境配置
- 路编程
- initial
- 匿名类和内部类
- 语法
- 页
-
abstract
what will be the result of attempting to compile and run the following code/p>
A asequence of 5 0’s will be printed
B Error: ar is used before it is initialized
C Error Mine must be declared abstract
D IndexOutOfBoundes Error
C
static
写出编译运行后的结果
zhang num=1
zhang number=1
wang num=2
wang number=1
jiang num=3
jiang number=1
What will happen if you try to compile and run the following code
a)error Can’t make static reference to void amethod.
b)error method main not correct
c)error array must include parameter
d)aMethod must be declared with String
B
Thread
11
12
13
14
下列说法不正确的是:
a)Java中线程是抢占式的;
b)Java中线程可以是抢占式也可以是分时的;
c)Java中线程可以共享数器;
d)Java中线程可以共享代码。
Which method should you define as the starting point of a new thread in a class from which new threads of execution can be madebr> a)public static void main(String[] args)
b)public void run()
c)public void start()
d)public void init()
e)public void runnable()
There are two ways to create a new thread of execution. One is to declare a class to be a subclass of Thread. This subclass should override the run method of class Thread.
下面哪个方法是启动新线程的方法:
a)只需创建
b)创建并调用start()
c)创建并调用begin()
d)创建并调用start Thread()
Java实现多线程的两种方法:
1.扩展java.lang.Tread类
2.实现java.lang.Runnable接口
Hello 0
Hello 0 1
Hello 0 1 2
Hello 0 1 2 3
finally
No such file found
Doing finally
-1
别漏掉-1
a)Thank you
b)I am sorry
c)Thank you
I am sorry
d)代码不能编译
Hello World!
Thank you!
package
说法正确的是;
a)其它包中的所有类可以访问变量i;
b)其它包中的所有类可以访问变量j;
c)其它包中的所有类可以访问变量k;
d)其它包中的所有类可以访问变量l;
e)其它包中只有Test子类才能访问l。
Exception
所有异常的基础类是
a)String
b)error
c)Throwable
d)RuntimeException
下面代码的结果是
a)compile time exception
b)runtime exception
c)compile with errors
d)一切正常
C
I/O
System是属于java中的哪一个包
a)lang
b)io
c)util
d)awt
关于System.out正确的是:
a)是一个OutputStream;
b)是一个PrintStream;
c)是一个FilterOutputStream;
d)异常时抛出IOException;
java API
true
true
false
What will happen if you attempt to compole and run the following code/p>
a)Compile and run without error
b)Compole time Exception
c)Runtime Exception
d)”everything is okay”D
![]()
请问下面代码的结果
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!