The toUpperCase()
function converts a string to uppercase.
The following figure shows a visual representation of the toUpperCase()
function.
String toUpperCase()
// Usage
string_1.toUppercase()
The toUpperCase()
function does not require a parameter.
The toUpperCase()
function returns a string that is converted to uppercase.
class JAVA {public static void main( String args[] ) {String string="educative";String string_1="Educative09";//to uppercase stringSystem.out.println("string.toUpperCase():");System.out.println(string.toUpperCase());//to uppercase string and numberSystem.out.println("string_1.toUpperCase():");System.out.println(string_1.toUpperCase());}}