Here is the program code you are expecting. And you can verify Sun's API for
JAVA and you can get the all info regarding.
import java.lang.*;
import java.io.*;
import java.lang.String;
import java.util.*;
import javax.swing.*;
class StringInfo
{
private StringTokenizer name;
private String dum;
private int len=0;
void getInput()
{
String nam=JOptionPane.showInputDialog("Enter Your name");
name=new StringTokenizer(nam) ;
while(name.hasMoreTokens())
{
dum=name.nextToken();
len+=dum.length();
System.out.println(dum);
}
System.out.println("The length of the string without counting spaces is "+ len);
}
}
class StringPro
{
public static void main(String args[])
{
StringInfo inf=new StringInfo();
inf.getInput();
}
}
Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)