读书人

请高手帮小弟我看下哪里异常了小弟我

发布时间: 2013-03-27 11:22:42 作者: rapoo

请高手帮我看下哪里错误了,我编译不出来,我还是初学者
public class helloworld{
/**
* author:wonderful
*/
public static void main(String [] args){
// TOD Auto-generated method stub
System.out.println("helloworld,当前的时间:");
SimpleDateFormar Foramt =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
format.setlenient(false);
System.out.println(format.format(new Date()));
}
}
[解决办法]


System.out.println("helloworld,当前的时间:");
SimpleDateFormat Foramt =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Foramt.setLenient(false);
System.out.println(Foramt.format(new Date()));

[解决办法]

import java.text.SimpleDateFormat;
import java.util.Date;

public class helloworld {
/**
* author:wonderful
*/
public static void main(String[] args) {
// TOD Auto-generated method stub
System.out.println("helloworld,当前的时间:");
SimpleDateFormat Format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Format.setLenient(true);
System.out.println(Format.format(new Date()));
}
}

读书人网 >Eclipse开发

热点推荐