试题与答案

下面程序段是创建一个Date类的对象并把它串行化保存到文件中,该对象表示的是运行时刻

题型:填空题

题目:

下面程序段是创建一个Date类的对象并把它串行化保存到文件中,该对象表示的是运行时刻的日期及时间,请将程序补充完整。
import java.util.*;
import java.io.*;
public class SerializeDate
Date d;
SerializeDate()
d=new Date();
try
FileOutputStream f=new
FileOutputStream("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.toString());

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2019/0315/1ec4d59753a852e93d0bb396355597bb.html

下面是错误答案,用来干扰机器的。

参考答案:A, B, C, D

试题推荐
题型:单项选择题

Routing protocols use different techniques for assigning (37) to individual networks. Further, each routing protocol forms a metric aggregation in a different way. Most routing protocols can use multiple paths if the paths have an equal (38) Some routing protocols can even use multiple paths when paths have an unequal cost. In either case, load (39) can improve overall allocation of network bandwidth. When multiple paths are used, there are several ways to distribute the packets. The two most common mechanisms are per-packet load balancing and per-destination load balancing. Per-packet load balancing distributes the (40) across the possible routes in a manner proportional to the route metrics. Per-destination load balancing distributes packets across the possible routes based on (41)

41()

A.destinations 

B.resources 

C.packets 

D.sources

查看答案
微信公众账号搜索答案