Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static Scanner s=new Scanner(System.in);
- static String words[];
- static String str;
- void perform(int i)
- {
- i++;
- if(i<(words.length-1))
- {
- perform(i);
- }
- System.out.print(words[i]+",");
- }
- public static void main(String[] args)
- {
- Test t=new Test();
- str=s.next();
- words=str.split("\s+");
- System.out.println("Length of words is-"+words.length);
- //Output is always 1
- t.perform(-1);
- }
Add Comment
Please, Sign In to add comment