Character.digit(char, int) doesn't know the diff of 'a' and 'A'

I did Character.digit('a', 16) and Character.digit('A', 16), and they both gave me 10. Is there a function that can decipher between capitals and lowercase.
I am trying to create a random sequence of characters...and I can't seem to figure out a good method to do this. I think the method Character.digit(char, radix) isn't the best of methods.

No! That is not the right method to use. You should have seen the API before posting your explanation.
Anyway, you could try this,
import java.util.Random;
Random r = new Random();
char upch = 'A' + r.nextInt(25); // for next random upper case letter
char lowch = 'a' + r.nextInt(25); // for next random lower case letterI assume that, by characters in your question, you meant English alphabet.
HTH

Similar Messages

Maybe you are looking for

  • PROCEDURE IS NOT EXECUTED WITH IN THE DATABASE TRIGGER

    The follwing databse trigger works fine but the procedure lv_calc_pkg.p_orders_executed(:new.stock_code,:new.selling,:new.buying,:new.qty,:new.price); is not executed please help CREATE OR REPLACE TRIGGER SE.LV_SUMMARY_TRADE_TR AFTER INSERT ON SE.LV_

  • Pdf form for data from another form with data, xml or pdf, tables not expanding

    Sir, I am using Adobe Acrobat 9 Pro and LifeCylce to do these forms. I have made several subforms for a Risk Assessment for the mission they fly. I have also made up another form with tables that would connect with each subform data. This form also w

  • How to capture hi8 super8?

    Hi, I have my Imac connect to a Dv converter what has S-video and composite. Now i would like to Be able to capture Super video, Video8 and Hi8. I don't know much about what play i have to get to work. Is there anyone who can tell me, if there is a u

  • HT5242 Anyone know what the "extended period of time" is?

    Anyone know what the "extended period of time" is when the Java update decides for us when it should turn off automatic applet running?  Looking forward to the hack which allows us to fix that and make the decision ourselves.

  • Very new here - Methods

    I have this in a class UsefulClasses.MyMaths public static int generateRandomNumber(int n) { return (int)(Math.random() * n) + 1; I am trying to create a calculator that generates 2 random numbers and asks user to multiply them. I am obviously lost i