题目内容

线程在____和____状态时,调用isAlive()方法返回的值是false。

查看答案
更多问题

InetAddress对象使用怎样的格式来表示自己封装的地址信息?____

文件E.java的长度是51个字节,请写出E类中标注的【代码1】的输出结果____。import java.io.*;public class E { public static void main(String args[]) { File f = new File("E.java"); try{ RandomAccessFile in = new RandomAccessFile(f,"rw"); System.out.println(f.length()); //【代码1】 FileOutputStream out = new FileOutputStream(f); System.out.println(f.length()); //【代码2】 } catch(IOException e) { System.out.println("File read Error"+e); } }}

文件E.java的长度是51个字节,请写出E类中标注的【代码2】的输出结果____。import java.io.*;public class E { public static void main(String args[]) { File f = new File("E.java"); try{ RandomAccessFile in = new RandomAccessFile(f,"rw"); System.out.println(f.length()); //【代码1】 FileOutputStream out = new FileOutputStream(f); System.out.println(f.length()); //【代码2】 } catch(IOException e) { System.out.println("File read Error"+e); } }}

请写出E类中标注的【代码1】的输出结果____。import java.io.*;public class E { public static void main(String args[]) { int n=-1; File f =new File("hello.txt"); byte [] a="abcd".getBytes(); try{ FileOutputStream out=new FileOutputStream(f); out.write(a); out.close(); FileInputStream in=new FileInputStream(f); byte [] tom= new byte[3]; int m = in.read(tom,0,3); System.out.println(m); //【代码1】 String s=new String(tom,0,3); System.out.println(s); //【代码2】 m = in.read(tom,0,3); System.out.println(m); //【代码3】 s=new String(tom,0,3); System.out.println(s); //【代码4】 } catch(IOException e) {} }}

答案查题题库