I have the following method which I would like to modify so the method returns the words as an array of strings rather than printing them which happens at the moment.
public static String test()
String str = "This is a string object";
String words = str.split (" ");
for (int i=0; i < words.length; i++)