need java help -project uncoding, String to char

Status
Not open for further replies.

gohand

In Runtime
Messages
151
I was stucked at a java project that i needed for the school, cause i haven't write java for some times. i needed basically to input a string and then convert the variable to char then add a number to it, then convert it back to a String, so it can be encrypted, the goal is to: for example: input abcd, output cdef; etc.

my problem is that i cannot convert a String variable into a char maybe i used the wrong method, i am short of doing it by use JOptionPane as a String and use the (char) it'll say inconvertable type or something. and i was having trouble understanding the usage of var.charAt(0) and why do they need to put a + as in j+=p.charAt(0); can some one who are experienced in java help me to explain what those syntax is use for and what should the general structure of this program should be done with what methods and syntax? thx a lot in advence!
 
Status
Not open for further replies.
Back
Top Bottom