题库 题库
🏠 天天查询 > 题库 > JAVA

JAVA

单选题 对鼠标点击按钮操作进行事件处理的接口是 查看答案
单选题 AWT中用来表示颜色的类是 查看答案
单选题 下列运算符中,优先级最高的是 查看答案
单选题 下列运算中属于跳转语句的是 查看答案
单选题 阅读下列利用递归来求n!的程序
Class FactorialTest{
Static long Factorial (int n) { //定义Factorial ()方法
If (n==1)
Return 1;
Else
Return n* Factorial(_____);
}
Public static void main (String a[]) { // main ()方法
Int n=8;
System.out.println{n+”! = ”+Factorial (n)};
}
}
为保证程序正确运行,在下划线处应该填入的参数是
查看答案
单选题 阅读下列代码
Public class Person{
Static int arr[ ] = new int (10);
Public static void main (String args  []) {
System.out.println(arr[9]);
}
}
该代码运行的结果是
查看答案
单选题 在Java中,若要使用一个包中的类时,首先要求对该包进行导入,其关键字是 查看答案
单选题 继承是面向对象编程的一个重要特征,它可降低程序的复杂性并使代码 查看答案
单选题 阅读下列代码片段
Class InterestTest________ActionListener{
Public void actionPerformed (ActionEvent event) {
Double interest = balance * rate/100;
Balance += interest;
Number Format format =
Number Format.getCurrencyInstance ();
System.out.printlb{“balance = ”+
Formatter.format (balance)};
}
Private double rate;
}
在下划线处,应填的正确选项是
查看答案
单选题 下列方法中,不属于类String的方法是 查看答案
单选题 grid (9)[5]描述的是 查看答案
单选题 Java类库中,将信息写入内存的类是 查看答案
单选题 阅读下列Java语句
ObjectOutputStream out
New ObjectOutputStream {new_______(“employee.dat”)};
在下划线处,应填的正确选项是
查看答案
单选题 使新创建的线程参与运行调度的方法是 查看答案
单选题 Java中的线程模型由三部分组成,与线程模型组成无关的是 查看答案
单选题 向Applet传递参数正确的描述是 查看答案
单选题  (题干缺失,请选A) 查看答案
单选题 Applet的默认布局管理器是 查看答案
单选题 阅读下列代码段
Class Test implements Runnable {
Public int run( ) {
Int i = 0;
While (true) {
i++;
System.out.println (“i=”+i);
}
}
}
上述代码的编译结果是
查看答案
单选题 如果线程调用下列方法,不能保证使该线程停止运行的是 查看答案
单选题 下列数据结构中,属于非线性结构的是 查看答案
单选题 下列数据结构中,能够按照“先进后出”原则存取数据的是 查看答案
单选题 对于循环队列,下列叙述中正确的是 查看答案
单选题 算法的空间复杂度是指 查看答案
单选题 软件设计中划分模块的一个准则是 查看答案
单选题 下列选项中不属于结构化程序设计原则的是 查看答案
单选题 软件详细设计产生的图如下:
  
该图是
查看答案
单选题 数据库管理系统是 查看答案
单选题 在E-R图中,用来表示实体联系的图形是 查看答案
单选题 有三个关系R,S和T如下:
其中关系T由关系R和S通过某种操作得到,该操作为
查看答案
单选题 用于设置组件大小的方法是 查看答案
单选题 点击窗口内的按钮时,产生的事件是 查看答案
单选题 AWT中用来表示对话框的类是 查看答案
单选题 下列运算符中,优先级最高的是 查看答案
单选题 下列运算结果为1的是 查看答案
单选题 下列语句中,可以作为无限循环语句的是 查看答案
单选题 下列表达式中,类型可以作为int型的是 查看答案
单选题 阅读下列程序
Public class Test implements Runnable{
Private int x=0;
Private int y=o;
boolean flag=true;
Public static void main(string[ ] args) {
Test  r =new Test( );
Thead t1=new Thead(r);
Thead t2=new Thead(r);
t1.start( );
t2.start( );
}
Public void run(){
While(flag) {
x++;
y++;
system.out.println(“(” +x_ “,”+y+”)”);
if (x>=10)
flag=false;
}
}
}
下列对程序运行结果描述的选项中,正确的是
查看答案
单选题 如果线程正处于运行状态,则它可能到达的下一个状态是 查看答案
单选题 在下列程序的空白处,应填入的正确选项是
import java.io.*;
Public class writeInt{
Public static void main(string[ ] a) {
Int[ ] myArray = {10,20,30,40};
try{
DataOutputSystem dos= new DataOutputSystem
(new FileOutputSystem(“ints.dat”));
for  (int i=0;I<myArray.length;i++)
dos。writeInt(myArray[i]);
dos.
System.out.println
(“Have written binary file ints.dat”);
}
Catch(IOException ioe)
{    System.out.println(“IO Exception”);
}
}
}
查看答案
单选题 在一个线程中调用下列方法,不会改变该线程运行状态的是 查看答案
单选题 在关闭浏览器时调用,能够彻底终止Applet并释放该Applet所有资源的方法是 查看答案
单选题 为了将HelloApplet(主类名为HelloApplet.class)嵌入在greeting.html文件中,应该在下列greeting.html文件的横线处填入的代码是
<HTML>
<HEAD>
<TITLE> Greetings </TITLE>
</HEAD>
<BODY>
<APPLET ______>
</APPLET>
</BODY>
</HTML>
查看答案
单选题 下列变量名的定义中,符合Java命名约定的是 查看答案
单选题 自定义异常类的父类可以是 查看答案
单选题 阅读下列程序片段
Public void test(){
Try{
sayHello();
system.out.println(“hello”);
} catch (ArrayIndexOutOfBoundException e) {
System.out.println(“ArrayIndexOutOfBoundException”);
}catch(Exception e){
System.out.println(“Exception”);
}finally {
System.out.println(“finally”);
}
}
如果sayHello( )方法正常运行,则test( )方法的运行结果将是
查看答案
单选题 为使Java程序独立于平台,Java虚拟机把字节码与各个操作系统及硬件 查看答案
单选题 Java中的基本数据类型int在不同的操作系统平台的字长是 查看答案
单选题 String、StingBuffer都是______类,都不能被继承。 查看答案
单选题 下列程序的功能是统计字符串中“array”的个数,在程序的空白处应填入的正确选项是
public class FindKeyWords{
public static void main(sring[] args){
sting text=
“ An array is a data structur that stores a collection of”
+ “values of the same type . You access each individual value”
+ “through an integer index . For example,if a is an array”
+ “of inergers, then a[i] is the ith integer in the array.”;
Int arrayCount =0;
Int idex = -1;
Sting arrarStr =”array”;
Index = text.indexof(arrayStr);
While(index          0) {
++arrayCount;
Index += arrayStr.length();
Index = text.indexof(arrayStr,index);
}
System.out.println
(“the text contains” + arrayCount + “arrays”);
}
}
查看答案