How to use String.format ("format",....) [message #144277] |
Tue, 21 March 2006 13:58  |
Eclipse User |
|
|
|
Originally posted by: lbriones.san.rr.com
I am using Eclipse 3.1.2 and trying out the exercises from "Java How To
Program" book by Deitel....
Exercise Fig 8.1 ... excerpt
// convert to String in universal-time format (HH:MM:SS)
public String toUniversalString()
{
return String.format( "%02d:%02d:%02d", hour, minute, second );
} // end method toUniversalString
For some reason, the "return String.format ..." is not liked by/in
Eclipse ..... any hints (I attempted to find out suing the cntl spacebar
on how I can overcome it?
Any hints are welcome
|
|
|
Re: How to use String.format ("format",....) [message #144287 is a reply to message #144277] |
Tue, 21 March 2006 14:04  |
Eclipse User |
|
|
|
Originally posted by: lbriones.san.rr.com
Sorry ...
A response had been posted already ....
"You have to make sure your project is using a Java 5.0 JRE, and that the
compiler compliance settings are set to Java 5.0. Go to
Window->Preferences->Java->Compiler and change the Compiler compliance
level combo to 5.0.
Hope this helps,"
Yes, Jeff - this worked...
Thanks a million
|
|
|
Powered by
FUDForum. Page generated in 0.08372 seconds