File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use "toHexString"?

 
lauren bai
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create a class as follows:
class DoubletoHexString {

public static void main(String[] args) {

Double a = new Double(Double.NaN);

System.out.println("a: " + a.doubleValue());
System.out.println("doubletoHexString: " + Double.toHexString(a.doubleValue()));
}
}


I got compile error
DoubletoHexString.java:8: cannot resolve symbol
symbol : method toHexString (double)
location: class java.lang.Double
System.out.println("doubletoHexString: " + Double.toHexString(a.doubleValue()));


I check my spelling is correct. Can anybody tell why it's not correct?
[ April 14, 2005: Message edited by: lauren bai ]
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code is correct. In Float and Double, the toHexString method is new with Java 1.5, so I'm guessing that you are using an earlier version compiler.
 
lauren bai
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,Marc, you are so right. I even didn't notice that.
I study 1.5 API but run on 1.4.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic