<<interface>>
Actionable
+ countWords(value:String):int
+ getFirstWord(value:String):String
Write a class named Helpers, which implements the Actionable interface. The class Helpers implements all methods in Actionable as below:
+countWords(value:String):int-return the number of words in a string.
6 of 6
Paper No: 1
+getFirstWord(value: String):String-return the first word in the string with the first letter in uppercase
The program output might look something like this:
Enter a string:iphone 15 pro max
Enter a string:iphone 15 pro max
1.Test countWords()
Zoom
+ 90%
1.Test countWords()
Close