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