Results 1 to 5 of 5
  1. #1
    cuziwow is offline Member
    Join Date
    Apr 2010
    Posts
    3
    Rep Power
    0

    Default uppercase and lowercase please help

    i want to write a program that defines whether the input letter is upper case or lower case. how do i do that, I think i need 2 arrays, one with all upper case and one with all lowercase?

  2. #2
    Cemi's Avatar
    Cemi is offline Member
    Join Date
    Apr 2010
    Posts
    36
    Rep Power
    0

    Default

    If you have a char variable.

    Character.isUpperCase(yourChar);

    Is going to equal true, and if it's lower case it will equal false :)
    Carpe Diem
    Each day's a gift and not a given right

  3. #3
    cuziwow is offline Member
    Join Date
    Apr 2010
    Posts
    3
    Rep Power
    0

    Default

    Thanks a lot lot lot :D

  4. #4
    blazinhieu is offline Member
    Join Date
    Mar 2010
    Posts
    8
    Rep Power
    0

    Default

    How can i make the program to tell the user what letter of the alphabet it is:
    ex: " k is the 11th letter in the alphabet"
    here is the code that i got so far

    Java Code:
    import javax.swing.*;
    public class Ncom{
    String Inputnum;
    char num;
    int i;
    public static void main(String[] args){
    new Ncom();
    }
    public Ncom(){
    char []upper = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
    char []lower = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
       
    Inputnum=JOptionPane.showInputDialog("Enter a letter");
    num= Inputnum.charAt(0);
    if (Character.isUpperCase(num))
    
    System.out.println(num+" is Upper case");
    else
    System.out.println(num+" is Lower case");
    
    
      
    
    }
    }
    PLEASE HELP ME just this 1 more thing

  5. #5
    cuziwow is offline Member
    Join Date
    Apr 2010
    Posts
    3
    Rep Power
    0

Similar Threads

  1. Need Help for this problem Uppercase.
    By ezered in forum New To Java
    Replies: 5
    Last Post: 12-04-2009, 12:05 AM
  2. UpperCase problem
    By logieen in forum New To Java
    Replies: 1
    Last Post: 08-03-2008, 11:26 PM
  3. String uppercase/lowercase
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-19-2007, 09:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •