Convert "char" into "string" in java

P

privetv7

ppl... HELP!!!!!
i don't know how to convert String into char.....

for example i can do

String input;
int number;
input = JOptionPane.showInputDialog( "Enter what ever" );
number = Integer.parseInt(input)


-
privetv
 
P

Peter van der Goes

privetv7 said:
ppl... HELP!!!!!
i don't know how to convert String into char.....

for example i can do

String input;
int number;
input = JOptionPane.showInputDialog( "Enter what ever" );
number = Integer.parseInt(input);
Well, first you'll need to find a group for Java. This is the Microsoft
public group for C++ in .NET.
I'll suggest the following possibilities:

alt.comp.lang.java
comp/lang.java.programmer

are two places that should work for you.
In the meantime, you might investigate the Java Character wrapper class.
 
A

Alessandro Angeli [MVP::DigitalMedia]

privetv7 said:
ppl... HELP!!!!!
i don't know how to convert String into char.....

for example i can do

String input;
int number;
input = JOptionPane.showInputDialog( "Enter what ever" );
number = Integer.parseInt(input);

And why would you be asking a question about Java on a
Managed VisualC++ .NET group?? A question about Sun's Java,
by the way, and not even J#.

Anyway:

if(input.length() == 1) {
char c = input.charAt(0);
} else {
/// ERROR!
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top