This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


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: 14952
    
  26

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: DateFormat question
 
It's not a secret anymore!