Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to convert char to string

843810Apr 12 2006 — edited Oct 31 2006
hi, sorry for the simple question.
thanks.

test.java:71: cannot find symbol
symbol : method toString(int)
location: class java.lang.Character
String s = Character.toString(k);
^
1 error
public void actionPerformed(ActionEvent evt)
{
try
{
Runtime r = Runtime.getRuntime();
Process p = null;
str = tf1.getText();
p = r.exec(str);
InputStream is = p.getInputStream();
// FileReader fo = new FileReader(p);
BufferedInputStream br = new BufferedInputStream(is);
int k;
text.setText("");
while((k = br.read()) != -1)
{ [u]String s = Character.toString(k);
text.append(s);
text.append("\n"); }


}
catch(Exception exe)
{

text.setText("\t\t"+"file not found:");
text.append("\n");
}
}

}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2006
Added on Apr 12 2006
4 comments
389 views