Conversation
| public class Class1 { | ||
| public final String SPECIAL_CHARACTER = "a"; | ||
| | ||
| public List<String> method(String paragraph) { |
There was a problem hiding this comment.
change method name to something more descriptive of what the method does(i.e. getShortestWordsWithAInEachSentece)
There was a problem hiding this comment.
also get as input the character u wanna check for so that it is more general.
| | ||
| public String findFirstShortWordStartingWithA(String paragraph) { | ||
| List<String> shortestWordsWithA = method(paragraph); | ||
| String firstShortWordStartingWithA = ""; |
There was a problem hiding this comment.
Doesn't make sense to assign a empty String, maybe it would be better to start form the first element in the list.
There was a problem hiding this comment.
and the naming of this doesn't rly fit in with what the variable represents. I would suggest to rename it to shortestWordWithA
| import java.util.Collections; | ||
| | ||
| public class Class1 { | ||
| public final String SPECIAL_CHARACTER = "a"; |
There was a problem hiding this comment.
this isn't needed in my opinion.
| return shortestWords; | ||
| } | ||
| | ||
| public String findShortestWordWithA(String paragraph) { |
There was a problem hiding this comment.
Update to give as input the special character as well so that it is more general.
| } | ||
| | ||
| | ||
| public String findFirstShortWordStartingWithA(String paragraph) { |
No description provided.