Consider the following method: public static String capitalize(String word) { return word.substring(0, 1).toUpperCase() + word.substring(1); } Assume that the following code segment appears in a class: String result = capitalize("hello"); System.out.println("Capitalized word: " + result); What is printed as a result of executing the code segment?




© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.