Skip to main content



      Home
Home » Newcomers » Newcomers » How to use String.format ("someformat",...)
How to use String.format ("someformat",...) [message #144206] Tue, 21 March 2006 11:36 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Changing the color of numbers in the Editor
Next Topic:"Unknown respone from server" on import from CVS
Goto Forum:
  


Current Time: Tue Jun 10 07:32:13 EDT 2025

Powered by FUDForum. Page generated in 0.10458 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top