How to capitalize the first letter of a String in Java

In Java, we can use substring(0, 1).toUpperCase() + str.substring(1) to make the first letter of a String as a capital letter (uppercase...