- 下面那些方法不是接口 Collection 中已声明的方法 ( )?
- 下面的程序创建了一个文件输出流对象,用来向文件test.txt 中输出数据,假设程序当前目录下不存在文件test.txt,编译下面的程序 Test.java后,将该程序运行 3 次,则文件 test.txt 的内容是 ( )。import java.io.*;public class Test {public static void main(String args[]) {try {String s="ABCDE";byte b[]=s.getBytes();FileOutputStream file=new FileOutputStream("test.txt",true);file.write(b);file.close();}catch(IOException e) {System.out.println(e.toString());}}}
- 应用程序的 main 方法中有以下语句,则输出的结果是 ( )。String s1="0.5", s2="12";double x=Double.parseDouble(s1);int =Integer.parseInt(s2);System.out.println(x+y);
- 程序 Test.java编译运行后输出的结果是 ( )。public class Test {String s1="java";public static void main(String args[]) {int z=2;Test t=new Test();System.out.println(t.s1+z);}}
- 应用程序的 main 方法中有以下语句,则执行后输出的结果是 ( )。
- 应用程序的 main 方法中有以下语句,则输出的结果是 ( )。int b[][]={{1}, {2,2}, {2,2,2}};int sum=0;for(int i=0;ifor(int j=0;jsum*=b[i][j];}}System.out.println("sum="+sum);
- 应用程序 Test.java的源程序如下,在命令行键入:java Test aaa bb c回车后输出的结果是 ( )。public class Test {public static void main(String args[]) {int k1=args.length;int k2=args[1].length();System.out.print(k1+""+k2);}}
- 下面程序段执行后 b 的值是 ( )。Integer integ =new Integer(9);boolean b = integ instanceof Object;
- 应用程序的 main 方法中有以下语句,则输出的结果是 ( )。String s="12345#aaa#bbb#67890";int n=s.indexOf("#");int k=s.indexOf("#",n+1);int m=s.indexOf("#",k+1);String s2=s.substring(m+1);System.out.println(s2);
- 下面语句的功能是 ( )。RandomAccessFile raf2 = new RandomAccessFile("1.txt","rw" );
首页上一页165
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410
尾页下一页 置顶