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. it is 3 days since I searched resolution. It was h
View Tutorial          By: Daniel Costa at 2009-02-25 06:11:27

2. Sir!
I want the source code for receiv

View Tutorial          By: Anupam Shukla at 2010-04-30 00:09:25

3. How can you print this using recursion?

View Tutorial          By: Menon at 2011-09-08 07:16:02

4. In the above example..where you make the GC1 objec
View Tutorial          By: prasad at 2014-12-11 11:12:28

5. hi..i did a sms sending pgm..it works without erro
View Tutorial          By: Ragesh Gopal at 2011-09-02 10:02:59

6. Pastoral College is a small college in the Midwest
View Tutorial          By: James Chui at 2015-08-03 00:48:50

7. its useful code.
but i want to write in a f

View Tutorial          By: SARWAR at 2011-08-02 06:26:37

8. great material for language bugs....
View Tutorial          By: manoj kapri at 2009-11-30 00:30:13

9. I am getting error in setContentView(R.layout.main
View Tutorial          By: user at 2012-01-13 06:49:42

10. I have download that 5 files .But how to run this
View Tutorial          By: Unnati at 2011-07-07 06:07:26