int()方法所有正确的描述:(单选)
30 分析以下代码,选择所有正确的答案。(单选)
void looper()
{
int x=0;
one;
while(x<10)
{
two;
Syatem.out.println(++x);
If(x>3)
Break twc;
}
}
}
31.根据下面的程序判断正确的表达式?(单选)
int[ ] arr ={1,2,3};
for (int i=0; i<2; i++)
arr[i]= 0;
32. 下列关于try, catch 和finally的正确描述是?(多选)
33. 创建一个新的RandomAccessFile对象的合法模式是?(多选)
a. “ w ” b. ” r ” c. ” x ” d. ”rw”
34. 当你试图编译和运行这段代码时,将得到什么结果?(单选)
abstract class Base{
abstract public void myfunc();
public void another(){
System.out.println(“Another method”);
}
}
public class Abs extends Base{
public static void main (String argv[ ]){
Abs a =new Abs();
a.amethod();
}
public void myfunc(){
System.cut.println(“My Func”);
}
public void amethod(){
myfunc();
}
}
35. 以下哪一个是java modifiers(多选)
a.public b. private c. friendly d. transient e. vagrant
36. 当你试图编译和运行这段代码时,将得到什么结果?(单选)
public class Mod{
public static void main (String [] argv[]){
}
public static native void amethod();
}
37. 当你试图编译和运行这段代码时,将得到什么结果?(单选)
private class Base{}
public class Vis{
transient int iVal;
public static void main (String elephant[]){
}
}
38. 当你试图编译和运行这段代码时,将得到什么结果?(单选)
public class Bground extends Thread{
public static void main(String[] args){
Bround b =new Bground();
b.run();
}
public void start(){
for (int i =0;i<10;i++)
System.out.println(“Value of i=”+i)
}
}
39. 如何使一个线程停止执行?(单选)
40. 下列哪一个是JVM执行垃圾收集命令的正确语法?(单选)
41. 当你试图用命令“hello there”编译和运行这段代码时,将得到什么结果?(单选)
public class Arg{
String [] MyArg;
public static void main (String[] argv){
MyArg=argv;
}
public void amethod(){
System.out.println(argv[1]);
}
}
42. 当你试图编译和运行这段程序时,将得到什么结果?(单选)
public class Outer{
public String name=”Outer”;
public static void main (String[] argv){
Inner i =new Inner();
i.showName();
}//End of main
private class Inner{
String name=new String (“Inner”);
Void showName(){
System.out.println(name);
}
}//End of Inner class
}
43. 当你试图编译和运行这段代码时,将得到什么结果?(单选)
import java.awt.event.*;
import java.awt.*;
public class MyWc extends Frame implements WindowListener{
public static void main (String[] args){
MyWc mwc=new MyWc();
}
public void windowClosing(WindowEvent we){
System.exit(0);
}//End of windowClosing
public void MyWc(){
setSize(300,300);
setVisible(true);
}
}//End of class
44. 当你试图编译和运行这段代码时,最完整的描述是哪个选项?(多选)
public class MyAr{
public static void main(String[] args){
MyAr m = new MyAr();
m.amethod();
}
public void amethod(){
static int i ;
System.out.println(i);
}
}
45. 下列哪一个是Java关键字?(单选)
46. 下列哪一个是Java关键字?(单选)
System.out.println(010|4);
47. 下列哪个类编译时不会出错?(多选)
interface IFace{}
class CFace implements IFace{}
class Base {}
public class ObRef extends Base{
public static void main (String[] args){
ObRef ob =new ObRef();
Base b = new Base();
Object o1=new Object();
IFace o2=new Cface();
}
}
48. 下列哪个是线程类的方法?(多选)
49. 根据提供的如下代码,请问在//A处应该补充什么代码,该程序方可运行并且得到当前时间?
Hello! The time is now//A
a. <% new java.util.Date()%> b. new java.util.Date() c.<%=new java.util.Date()%>
50. 根据以下的代码,如果hello.jsp已经在正确的目录下,请问在//A处应该补充什么代码该程序可以正常运行?(多选)
Going to include hello.jsp…
//A