Pisahkan Kalimat jadi Kata

//by : giri
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Main m = new Main();
    }
    public Main() {
        TokeIt();
    }
    public void TokeIt(){
        try{
        String word = "namaku giri tinggal di bandung";
        StringTokenizer toke = new StringTokenizer(word," ");
        int i = 1;
        while(toke.hasMoreTokens()){
            System.out.println("word ke "+i+": "+toke.nextToken());
            i++;
        }
        }catch(Exception ex){
            System.err.println(ex);
        }
    }
}
download file ---------DISINI-------

One Response

  1. mantabs.. thanks infonya,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: