i saw this code in a book.
import java.util.*;
public class test4
{
public static void main(String args[])
{
Calendar c=Calendar.getInstance();
System.out.format("%tB %td,%tY%n",c,c,c);
System.out.format("%tl:%tM %tp%n",c,c,c);
System.out.format("%tD%n",c);
}
}
but when i compile this i got some errors.
like..
test4.java:12: cannot resolve symbol
symbol : method format (java.lang.String,java.util.Calendar,java.util.Calendar,
java.util.Calendar)
location: class java.io.PrintStream
System.out.format("%tB %td,%tY%n",c,c,c);
^
test4.java:13: cannot resolve symbol
symbol : method format (java.lang.String,java.util.Calendar,java.util.Calendar,
java.util.Calendar)
location: class java.io.PrintStream
System.out.format("%tl:%tM %tp%n",c,c,c);
^
test4.java:14: cannot resolve symbol
symbol : method format (java.lang.String,java.util.Calendar)
location: class java.io.PrintStream
System.out.format("%tD%n",c);
^
3 errors
what is wrong with this code ?
is it necessary to import any other packages ?
please tell me....