u****s 发帖数: 2186 | 1 public class Test {
static
{
System.out.println("Hello World!");
}
public static void main(String [] args)
{
Date date = new Date(0);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:
ss");
format.setTimeZone(TimeZone.getTimeZone("UTC"));
System.out.println(format.format(date));
}
}
Compile error or runtime error?
If no error, what will be printed?
put your answer here before you actually try the code. |
s***8 发帖数: 1136 | |
u****s 发帖数: 2186 | 3 wrong.
【在 s***8 的大作中提到】 : rt error.
|
w****u 发帖数: 3147 | 4 1970那个?
【在 u****s 的大作中提到】 : wrong.
|
J*******i 发帖数: 2162 | 5 compile error?
Because Date(long date), but 0 is treated as int by default? |