aspose file tools*
The moose likes Beginning Java and the fly likes How do I import SimpleDateFormat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do I import SimpleDateFormat?" Watch "How do I import SimpleDateFormat?" New topic
Author

How do I import SimpleDateFormat?

Sheldon Plankton
Ranch Hand

Joined: Feb 11, 2004
Posts: 33
bash-2.03$ cat TimeStamp.java

bash-2.03$ javac -verbose TimeStamp.java
[parsing started TimeStamp.java]
[parsing completed 221ms]
[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/lang/Object.class)]
[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/lang/String.class)]
[checking TimeStamp]

[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/lang/System.class)]
[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/io/PrintStream.class)]
[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/io/FilterOutputStream.class)]
[loading /usr/local/home/Plankton/SUNWappserver/jdk/jre/lib/rt.jar(java/io/OutputStream.class)]
[total 1210ms]
2 errors
bash-2.03$ env | grep CLASS
[ edited to preserve formatting using the [code] and [/code] UBB tags -ds ]
[ February 15, 2004: Message edited by: Dirk Schreckmann ]
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi Sheldon
Use,
import java.text.*;
and you should be fine..
Regards
Maulin
Sheldon Plankton
Ranch Hand

Joined: Feb 11, 2004
Posts: 33
Thanks! What should of clued me into the fact that I imported the wrong package? That's seems to be a source of frustration for me.
Alex Cano
Greenhorn

Joined: Oct 06, 2003
Posts: 11
Originally posted by Sheldon Plankton:
Thanks! What should of clued me into the fact that I imported the wrong package? That's seems to be a source of frustration for me.

A few things that might make your life less frustrating (in order of least time consuming):
1) Using an IDE that figures this stuff out for you (Eclipse is a great IDE and it's free)
2) Looking up package information in relavant code documentation
3) Googling for this type of info
I strongly recommend going with option 1) and using the rest as backups.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
As a new Java programmer is starting to learn the language and the standard libraries, I'd recommend not using a fancy IDE, which could hide some fundamental things that are good to know and understand. When the basics are understood and mastered, it's probably a safe and good time to move onto an advanced IDE.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I import SimpleDateFormat?