首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

请高手帮小弟我看下哪里异常了,小弟我编译不出来,小弟我还是菜鸟

2013-03-27 
请高手帮我看下哪里错误了,我编译不出来,我还是初学者public class helloworld{/*** author:wonderful*/pu

请高手帮我看下哪里错误了,我编译不出来,我还是初学者
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()));
}
}

热点排行