aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes DateFormat question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "DateFormat question" Watch "DateFormat question" New topic
Author

DateFormat question

adam Lui
Ranch Hand

Joined: Sep 03, 2007
Posts: 186

in order to successfully print that Date, I am trying to fix this code. (question copied from K&B book, chapter 6, p511)

can you help me to fix? this topic is still really confusing me!
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Class DateFormat is an abstract class. You cannot instantiate an abstract class, as you are doing in line 5 of your code. Replace line 5 with something like this:

And you also need to import java.util.Date.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DateFormat question