how to get individual words from a string in java

Solutions on MaxInterview for how to get individual words from a string in java by the best coders in the world

showing results for - "how to get individual words from a string in java"
Cali
05 Oct 2019
1{
2public static void main(String args[])
3{
4String str = "Hey this is Ram";
5String [] words = str. split(" ", 3);
6for (String word : words)
7System. out. println(word);