Java toUpperCase() method

    toUpperCase() method

    This method will allow you to convert the specified string in the upper case.

    Syntax-

    public String toUpperCase()  
    
    public String toUpperCase(Locale locale)  

    Example-

    public class Simple{  
        public static void main(String[] args) {      
          String s1="hello";  
          String s2=s1.toUpperCase();
          System.out.println(s2);
      }
    }  

    Output-