Tuesday, 13 September 2016

Write a method in Java which accepts a String argument and returns a number of words in it

One of my friends asked me to solve this. User will give the input through console and our program will show the total no of words present in the string.
Input: 
hello, Sourin whats up,what are you doing
Output:
No of words: 8

Implemented code:



Sample Output:



No comments:

Post a Comment