I have the user input a sentence (example " Hello this is some jello "). I already have that complete by having a method to do this. What the method does is take a user input (.nextLine) then stores the words of the sentence into String words and I use the split function to break up the sentence into individual words. What I want to do is find in a given word, how many characters are in the word (length method without using .length()), then read in a sentence(already created a method to obtain user input then I called it in the main to execute), put each word into an object(Maybe a loop but where? I tried Word words = new Word; Word is the public class and words comes from String words if that is correct, but I get LWord;32c8f6f8), then I can call the function that was created to get the length of the word in the object. Once I know the lengths I want to show the user the words that have the same length. Just looking for a push in the right direction to see if I can come up with anything I apologize if this is confusing and I will clarify it there are any questions. Thanks!
Jump to Post
try by overriding Object's toString method. if you don't, the application 'll just print the reference to the Object, and that looks like what you described above.
All 8 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.