单选题Java中所有包的第一条语句是
单选题以下选项中,不能作为合法常量的是( )。 A.1.234e04 B.1.234e0.4 C.1.234e+4 D.1.234e0
单选题使用下列的( )类可以实现在文件的任意一个位置读写一个记录。
单选题下面属于面向对象程序设计语言的是______。
单选题某二叉树有5个度为2的结点,则该二叉树中的叶子结点数是
单选题下面哪个Swing用户界面组件不是容器?______
A.JscrollPane
B.JFrame
C.JMenuBar
D.Japplet
单选题关于异常的含义,下列描述中最正确的一个是( )。
单选题当一个包含Applet的Web页面被其他页面覆盖时,被调用的Applet方法是______。
A.start()
B.init()
C.stop()
D.destroy()
单选题构造方法名必须与( )相同,它没有返回值,用户不能直接调用它,只能通过new调用。 A) 类名 B) 对象名 C) 包名 D) 变量名
单选题下面程序段的输出结果是( )。 publiCClaSsTest publicstatic voidmain(SthngarSs[]) inta,b; for(a=1,b=1;a<(z100;a++) if(b>=10)break; if(b%2=1) b+=2; continUe; System.out.println(a); A.5 B.6 C.7 D.101
单选题下面程序段的输出结果为______。
package test;
public class ClassA
{
int x=20;
static int y=6;
public static void main(String args[])
{
ClassB b=new ClassB();
b. go(10);
System. out. println("x="+b. x);
}
}
class ClassB
{
int x;
void go(int y)
{
ClassA a=new ClassA();
x=a. y;
}
}
单选题JDBC是面向( )的。
单选题三元条件运算符ex1?ex2:ex3,相当于下面的( )语句。
单选题在下面附属类方法中的下划线处应填入的正确参数是( )。 public void writeData( ______ ) throws IOException{ GregorianCalendar calendar=new GregorianCalendar(); calendar.setTime(hireDay); out.println(name+"|"+salary+"|" +calendar.get(Calendar.YEAR)+"I" +(calendar.get(Calendar.MONTH)+1)+"|" +calendar.get(Calendar.DAY_OF_MONTH)); }
单选题下列叙述中,错误的是______。
A.所有字节输入流都从InputStream类继承
B.所有字节输出流都从OutputStream类继承
C.所有字符输出流都从OutputStreamWriter类继承
D.所有字符输入流都从Reader类继承
单选题下面不属于Java语言实现机制的是( )
单选题下列代码的下划线处填入相同的类,该类是______。
public class Test{
public static void main(String[] args){
Jframe f = new Jframe();
f.setTitle ("menus");
f.setVisible(true);
f.setSize(500,400);
______ mb = new ______ ();
Jmenu m = new Jmenu("文件");
mb.add (m);
JmenuItem mi = new JmenuItem("打开") ;
m.add(mi);
}
}
单选题下列常见的系统定义中的异常中,______是数组越界异常。
单选题阅读下面程序 public class Operators And Expressions void equals Methodl() String1l=new String("how are you"); Strings2=new String("how are you"); System.out.println(s1==s2); public static void main(String args[]) Operators And Expressions Oper And Exp=new Operators And Expressions (); //用于复合类型数据的"=="运算符 OperAndExp.equalsMethodl(); 程序运行结果是( )。
单选题下列程序的功能是将一个整数数组写入二进制文件,在程序的下画线处应填入的选项是{{U}} {{/U}}。
import java.io.*; public class XieShuzu{
public static void main(String[]a){
int[]myArray=(10,20,30,40); try{
DataOutputStream dos= new DataOutputStream(new
FileOutput Stream("ints.dat")); for(int
i=0;i<myArray.length;i++) dos.______(myArray[i]);
dos.close();
System.out.println("已经将整数数组写入二进制文件:ints.dat");
}catch(IOException ioe) {System.out.println("IO
Excepr_on");} } }
A.writeArray
B.writeByte
C.writeInt
D.writeDouble