Results 1 to 5 of 5
- 04-11-2010, 03:42 AM #1
Member
- Join Date
- Apr 2010
- Posts
- 3
- Rep Power
- 0
- 04-11-2010, 04:05 AM #2
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
- 04-11-2010, 04:06 AM #3
Member
- Join Date
- Apr 2010
- Posts
- 3
- Rep Power
- 0
Thanks a lot lot lot :D
- 04-11-2010, 06:52 AM #4
Member
- Join Date
- Mar 2010
- Posts
- 8
- Rep Power
- 0
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"); } }
- 04-11-2010, 08:54 AM #5
Member
- Join Date
- Apr 2010
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Need Help for this problem Uppercase.
By ezered in forum New To JavaReplies: 5Last Post: 12-04-2009, 01:05 AM -
UpperCase problem
By logieen in forum New To JavaReplies: 1Last Post: 08-04-2008, 12:26 AM -
String uppercase/lowercase
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 10:22 AM
Bookmarks