执行下面的程序段,辅出结果为上【 】。 public class Q { public static void main (
执行下面的程序段,辅出结果为上【 】。 public class Q { public static void main (String argv[]) { int anar[]=new int[5]; System.out.pfintln(anar[0]); } }
执行下面的程序段,辅出结果为上【 】。 public class Q { public static void main (String argv[]) { int anar[]=new int[5]; System.out.pfintln(anar[0]); } }
第4题
下面程序段是创建一个Date类的对象并把它串行化保存到文件中,该对象表示的是运行时刻的日期及时间,请将程序补充完整。 import java.util.*; import Java.io.*; public class SerializeDate{ Date d; SerializeDate(){ d=new Date(); try{ FileOutputStream f=new EileOutputStream("date.ser"); ObjectOutputStream s=new ObjectOutputStream(f); 【 】 f.close(); } catch(IOException e){ e.printStackTrace(); } } public static void main(String args[]){ SerializeDate b=new SerializeDate(); System.out.println("The saved date is;"+b.d.to String()); } }
请帮忙给出正确答案和分析,谢谢!
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!