• Post Reply Bookmark Topic Watch Topic
  • New Topic

DateFormat giving me error message Dateformat cannot be applied to text please assist  RSS feed

 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DateFormat giving me error message Dateformat cannot be applied to text.Please Note: I copied this code from SCJP pg 483: The Locale Class

 
Ralph Cook
Ranch Hand
Posts: 479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get better help, in general, by giving the actual error message and the line to which it applies.

I assume you mean the compile error "The method getInstance() in the type DateFormat is not applicable for the arguments (int)" in the line



The problem is that getInstance does not take an int value, or in fact any value. I think the method you're looking for is getDateInstance(int).

 
Vishal Hegde
Ranch Hand
Posts: 1078
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oHH Thnks corrrected it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!