提供println()方法和print()方法的类是()
第1题:
接口是抽象方法和常量的集合,是一种特殊的抽象类。下面的程序是对接口的操作,请在程序的每条横线处填写一个语句,使程序的功能完整。
注意:请勿改动main()主方法和其他已有的语句内容,仅在横线处填入适当的语句。
______________MyInterface
{
public static int NUM=100;
public abstract void print();
}
public class ClassName___________MyInterface
{
public void print()
{
System.out.println(NUM);
}
public static void main(String args[])
{
__________________________
obj .print();
}
}
第2题:
在JSP页面中的输出语句是()。
A、System.out.print()
B、Println()
C、Out.println()
D、Out.printValues()
第3题:
在Java中,类Animal中的方法printA()定义如下:publicvoidprintA(){inta=10;intresult=10%3;System.out.println(result);}在类Dog中方法printA()定义如下:publicvoidprintA(){inta=10;System.out.println(a/3);}Dog类的定义如下:classDogextendsAnimal{…}.Animalanimal=newDog();animal.printA();以上语句输出为()。
A.0
B.1
C.2
D.3
E.3.3333
第4题:
在文件类提供的方法中,用于创建目录的方法是( )。
A.mkdir
B.mkdirs
C.list
D.listRoots
第5题:
阅读下列程序片段 Publicvoidtest(){ Try{ sayHello(); system.out.println(“hello"); }catch(ArrayIndexOutOfBoundExceptione){ System.out.println(“ArraylndexOutOfBoundException”); }catch(Exceptione){ System.out.println(“Exception”); }finally{ System.out.println(“finally”); } } 如果sayHello()方法正常运行,则test()方法的运行结果将是( )。
A.Hello
B.ArraylndexOutOfBondsException
C.Exception Finally
D.Hello Finally
第6题:
不属于JSP的out对象的方法的是( )。
A.getAttribute ()
B.print()
C.println()
D.close()
第7题:
A、提供了valueOf(String),tostring()
B、对象中所包装的值是可以改变的
C、equals()方法进行了覆盖
D、有的类提供了一些使用的方法以操作方便,例如Parse类就提供了parseDouble()、max、min方法等
第8题:
Atoll提供[]、[]和[]三类建立话务地图的方法
第9题:
下列说法中,不正确的一项是______。
A.可以用FileWriter对象作为PrintWfite类的构造方法的参数
B.可以用FileOutputStream对象作为PrintWrite类的构造方法的参数
C.PrintWriter类的println()方法不可以刷新输出缓冲区
D.PrintWriter类的println()方法可以刷新输出缓冲区
第10题:
A.PrintStream可以实现将基本数据类型的数据或引用数据类型的对象格式化成字符串后再输出
B.PrintStream类位于IO包中,是字符输出流的子类
C.调用println()方法和print()方法输出对象数据时,对象的toString()方法被自动调用
D.PrintStream类提供了一系列用于打印数据的print()和println()方法