hi
this code convert into String to hexa
import java.io.*;
import java.io.IOException.*;
public class StringToHexa{
public static void main(String args[])throws IOException{
System.out.println("This program convert string to Hexa");
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter string value!");
String st = buff.readLine();
for(int i = 0; i<st.length(); i++){
System.out.println();
int ch=(int)st.charAt(i);
String str="00"+Integer.toHexString(ch);
System.out.println("Place of " + i + " output is: " + str + ".");
}
}
}
This code convert into Hexa to string
import java.io.*;
public class HexaToString{
public static void main(String args[])throws IOException{
System.out.println("This program convert string to Hexa");
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter string value!");
String st = buff.readLine();
String s = new Integer(st).toString();
System.out.println("String value is : " + s);
}
}
---------------------------------------------------------------
Read for more information.
http://www.roseindia.net/java/java-conversion/