Comment on Tutorial - Converting Numbers to and from Strings using Java By Mashoud



Comment Added by : Doug Whitehead

Comment Added at : 2008-11-29 17:10:43

Comment on Tutorial : Converting Numbers to and from Strings using Java By Mashoud
Good examples. However... I am testing for a Hex value (07 or A0) in a string read from a file. How can I compare a one character string (retrieved with substring) to a constant int hex07 = 0x07 or int hexA0 = 0xA0.
I have tried parse, valueOf, etc. I could get there from bit-wise. But I can't get the String (i byte) to an integer. The parses/valueOf give me NUMBER FORMAT EXCEPTION.

I realize you are not QUESTIONS Central... But I Thought I would try... Doug


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Finally! You enlighted me in a small problem: it w
View Tutorial          By: Fernando Martin at 2011-02-25 12:54:58

2. hi this is from iniyan....
can you send t

View Tutorial          By: iniyan at 2007-09-09 06:50:18

3. This works great.. :)

thanks a lot

View Tutorial          By: Ravi at 2010-07-03 23:34:46

4. Here i posted a good example with spring. Here rea
View Tutorial          By: Vikash K Agarwal at 2011-11-02 12:02:50

5. good
View Tutorial          By: saravanan at 2007-03-02 23:16:00

6. good code
View Tutorial          By: neha at 2011-07-02 01:46:52

7. sir , i am new in j2me and i want to learn more s
View Tutorial          By: vipin Luhach at 2012-01-19 06:43:27

8. enter no of line: 5 not fix value
out put i

View Tutorial          By: mark at 2013-01-31 14:30:00

9. I executed this program with the help of below cod
View Tutorial          By: leela at 2011-09-08 12:16:24

10. thanks for your tutorial, but how to us it?

View Tutorial          By: Desman Gea at 2014-07-18 16:54:41