Hi
I'm a beginner on Java
so I hope you guys can help me
I want to know how to write (char)a1,(char) a2 ... (char)a4 in one System.out.prin t
also I want to know how can I write (char)a1 outside of the System.out.prin t, I mean
???? = (char)a1
please help :)
I'm a beginner on Java
so I hope you guys can help me
Code:
int a1 = str.charAt(0)+1;
int a2 = str.charAt(1)+1;
int a3 = str.charAt(2)+1;
int a4 = str.charAt(3)+1;
System.out.print("output :");
System.out.print((char)a1);
System.out.print((char)a2);
System.out.print((char)a3);
System.out.println((char)a4);
also I want to know how can I write (char)a1 outside of the System.out.prin t, I mean
???? = (char)a1
please help :)
Comment