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. Nice one
View Tutorial          By: Kalpana at 2009-11-17 02:04:14

2. This is all the code that you need for creating dr
View Tutorial          By: subduedjoy at 2012-03-20 20:52:18

3. Hi, you put a semicolon after "int main()&quo
View Tutorial          By: noel4037 at 2009-12-28 06:40:17

4. good;Every one can understand
View Tutorial          By: seshu at 2011-04-26 05:11:09

5. This example is very good, but it doesnt work in M
View Tutorial          By: soma at 2010-04-13 04:34:00

6. Good Luck....
View Tutorial          By: nagarajan at 2011-06-19 03:55:49

7. i have json data like coffeename and coffee prize
View Tutorial          By: Paramatma sharan upadhyay at 2015-09-21 12:14:31

8. This has tread error , copy and paster hole code a
View Tutorial          By: Daniel at 2015-01-21 16:24:36

9. hey pls tel me, what is the advantage of method ov
View Tutorial          By: divya at 2013-08-27 14:20:22

10. be very careful. use of put (or any method inheri
View Tutorial          By: d at 2009-10-14 09:55:23