here is what i did ....... hope this reference can help to newbies like me..
Code:
import java.io.*;
public class casestudy4 {
public static void main(String[] args)throws IOException {
BufferedReader enterstring=new BufferedReader(new InputStreamReader(System.in));
String inputstring;
String upper ="";
String lower ="";
String other ="";
System.out.print("Enter a String: ");
inputstring=enterstring.readLine();
for (int i = 0; i < inputstring.length(); i++) {
char thisChar = inputstring.charAt(i);
if (thisChar >= 65 && thisChar <= 90) {
upper += thisChar;
} else if (thisChar >= 97 && thisChar <= 122) {
lower += thisChar;
} else {
other += thisChar;
}
}
System.out.println("Upper case letters: " + upper.length() + " - " + upper);
System.out.println("Lower case letters: " + lower.length() + " - " + lower);
System.out.println("Other: "+other);
}
}
thread close......
Bookmarks