Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: coverting to Char?

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Exclamation coverting to Char?

    how would i convert numeric code to char? ive come stuck on a program and im not too sure how to change it over to char A-Z.. any help would be great


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: coverting to Char?

    Something like this

    System.out.println((char) 65 + " to " + (char) 90);

    // Json

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Posts
    22
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: coverting to Char?

    thanks for the Reply Json basically i have to modify my arrayUtil so it generates random chars im not too sure how to do it :S
    import java.util.Random;
     
    public class ArrayUtilOne
    {
     
    	public static int[] randomIntArray(int length, int n)
    	{
    		int[] a = new int[length];
    		for (int i = 0; i < a.length; i++)
    				a[i] = generator.nextInt(n);
    		return a;
    	}
    	private static Random generator = new Random();
    }

Similar Threads

  1. [SOLVED] Char cannot be dereferenced
    By zukipuu in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 17th, 2010, 11:13 PM
  2. Char cannot be dereferenced!! Please help
    By humdinger in forum Object Oriented Programming
    Replies: 5
    Last Post: February 14th, 2010, 03:18 PM
  3. char (toUppercase?)
    By chronoz13 in forum Java Theory & Questions
    Replies: 4
    Last Post: December 12th, 2009, 10:01 AM
  4. Convert CHAR to STRING
    By fh84 in forum What's Wrong With My Code?
    Replies: 11
    Last Post: October 29th, 2009, 09:21 PM
  5. Program to convert Hexadecimal to its Character equivalent
    By nathanernest in forum Java Theory & Questions
    Replies: 2
    Last Post: April 8th, 2009, 03:12 AM