|
||
|
|||
|
Hey all!
I have a problem lol. I am trying to convert a hexadecimal value to its character equivilent. The specific task is a school assignment and I am very open about this. I need to import a file which contains the contents of the said hexadecimal values, read the file and display the characters on the screen. I have EVERYTHING done except fot the actual conversion lol. I have the import, printing even the loops to read the file from start to finish. All I need now is to know how to actually do the conversion lol. Is there an easy way to do this? So my simple question is this. String fileContents = 004e //convert the file contents here Println(character) finished. How can this be done? \ Thanks all!!!
|
|
||||
|
Hello nathanernest and welcome to the Java Programming Forums
![]() To convert the fileContents String to its corresponding character value, you will probably need a load of 'if' statements. Can you please post the code you have so far, including the file it reads and I will take a look.
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight] Forum Tip: Add to peoples reputation ( ) by clicking the button on their useful posts.
|
|
||||
|
Here is an example:
Java Code
String fileContents = 004e
if(fileContents.equals("004e")){
System.out.println("E")
}
__________________
Don't forget to add syntax highlighted code tags around your code: [highlight=Java] code here [/highlight] Forum Tip: Add to peoples reputation ( ) by clicking the button on their useful posts.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hexadecimal BUGG.....er | Eric | Java Theory & Questions | 1 | 22-06-2009 04:36 PM |
| [SOLVED] Converting to and comparing integers. | luke | What's Wrong With My Code? | 9 | 18-05-2009 11:26 PM |
| Converting GSM 6.10 Wav file to other formats | expertise | Mobile Applications | 3 | 11-05-2009 11:24 AM |
| converting to .exe | haygaurav | Java IDEs | 4 | 01-05-2009 08:32 PM |
| code help 2 programs. MinMax Values & Converting Temps. | awake77 | What's Wrong With My Code? | 6 | 20-12-2008 09:12 PM |