converting 'char' to an integer

G

George Cherry

jan V said:
I'm a big fan of the concept... most people in management aren't.

That's because they don't--or can't--believe that pair programming
increases productivity.
Typically
you do what management tells you, or you're out of a job..

Or become a senior manager.
I've yet to come
across a company which truly embraces pair programming.

Interview management before you accept your next job offer.
: o )
 
J

Joan

Oliver Wong said:
Japanese. The character representing the concept of 1 (ichi)
has unicode codepoint U+4e00. The character representing the
concept of 2 (ni) has unicode codepoint U+4e8c. For 3 (san),
it's U+4e09. You can see the chart at
http://www.unicode.org/charts/PDF/U4E00.pdf.

If there's a pattern, I haven't figured it out (it's
certainly not ordered by stroke count, for example), but then
again I'm not a native speaker of Japanese. I'll have to ask
some Japanese friends if they can figure out the rationale for
this ordering.

- Oliver.
Can the OP provide more test cases pls?
If the set of inputs is small,you can just use a look up table
Or switch statement like this:

class A {
public static void main(String[] args) {
char jones = 'a';
int i;

switch (jones) {
default: System.err.println("you need a case
statement for " + jones);
System.exit(0);
case 'a' : i = 0;
break;
case 'b' : i = 1;
break;
// put rest of your cases here
}
System.out.println(jones);
System.out.println(i);
}
}
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top