How to use String.format ("someformat",...) [message #144206] |
Tue, 21 March 2006 11:36  |
Eclipse User |
|
|
|
Originally posted by: lbjtemp.yahoo.com
I am using Eclipse 3.1.2 and trying out the exercises ....
Exercise Fig 8.1 (from book Deitel's Java - How to Program)... 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 on how I can overcome it?
|
|
|
Re: How to use String.format ("someformat",...) [message #144216 is a reply to message #144206] |
Tue, 21 March 2006 11:47  |
Eclipse User |
|
|
|
Originally posted by: myersj.gmail.com
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,
- Jeff
|
|
|
Powered by
FUDForum. Page generated in 0.10458 seconds