import java.util.date;
public class HelloDate{
public static void main(string args[]){
system.out.println("Hello,it's:");
system.out.println(new Date());
}
}
保存 为HelloDate.java
然后javac HelloDate.java后报错
[root@localhost java]# javac HelloDate.java
HelloDate.java:1: cannot resolve symbol
symbol : class date
location: package util
import java.util.date;
^
HelloDate.java:3: cannot resolve symbol
symbol : class string
location: class HelloDate
public static void main(string args[]){
^
HelloDate.java:4: package system does not exist
system.out.println("Hello,it's:");
^
HelloDate.java:5: cannot resolve symbol
symbol : class Date
location: class HelloDate
system.out.println(new Date());
^
HelloDate.java:5: package system does not exist
system.out.println(new Date());
^
5 errors
[root@localhost java]#
import java.util.Date;
public class HelloDate{
public static void main(String args[]){
System.out.println("Hello,it's:");
System.out.println(new Date());
}
}