Search Interview Questions | Click here and help us by providing the answer. Click Correct / Improve and please let us know. |
|
|||
|
| ||||
| Interview Questions and Answers | ||||
| ||||
| Ans. public class BuggyBread { public static void main(String args[]) { String str = "we are what we repeatedly Do excellence, then, is not an act but a haBit"; String wordWithFirstCaptalChar = ""; for(String word:str.split(" ")){ if(Character.isUpperCase(word.charAt(0))){ wordWithFirstCaptalChar = word; } } System.out.println(wordWithFirstCaptalChar); } } | ||||