Here is a link to Sun's Java documentation. It's similar to other documentation (Microsoft's C++ documentation, for example) but better in most ways. In the specific case of MS the Sun documentation is a little more complicated but covers a lot more information and gives you a far better feel for how the language works as a whole and not just howt o "do" something.
http://java.sun.com/j2se/1.4.1/docs/api/index.html
I think you'll find that most tasks under java are surprisingly easy (well, very each compared to, say, a performance language such as C but fairly hard compared to a **** language like perl).
Specifically, you want to check out java.lang.String and java.util.regex. There are a ton of methods that will help you--the most nieve way would probably be to do something along these lines (I'll assume you know type types):
import java.lang.String;
import java.util.regex.*;
class test {
public static void main(String []args) {
String stringName="123a bc 45 6defg l\t0lNH";
int letters=0,digits=0;
for (int n=0;n<stringName.length();n++) {
if( Pattern.matches([a-zA-Z],stringName.charAt(n)) ) {
letters++;
} else if ( Pattern.matches([0-9],stringName.charAt(n)) ) {
digits++;
} // if-else-if
} // for loop
System.out.println("numbers: "+digits+"\nletters: "+letters);
} // main
} // class test
There are far quicker ways to accomplish this (for one, you'd want to be compiling the regular for reuse) and i'm pretty sure this won't compile (it's closer to perl than java) but it gives you the general idea. So i'm leaving a little excersize for you, i guess. I haven't actually done regular expressions in java without using Jlex so you'll probably run into a problem with those.
If i had to do it myself I'd try to make the code a little more concise and change the decision statements to something slightly more elegant.