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 wordWithCaptalChar = ""; for(String word:str.split(" ")){ if(!word.equals(word.toLowerCase())){ wordWithCaptalChar = word; } } System.out.println(wordWithCaptalChar); } } | ||||