Answer:
myString=myString.toUpperCase();
Explanation:
In java to change all characters of a string to upper case we use .toUpperCase() method.It will convert string to upper case.
Implementation in java.
import java.util.*;
class Solution
{
public static void main (String[] args) throws java.lang.Exception
{
try{
Scanner scr=new Scanner(System.in);
System.out.print("Enter a string:");
String myString=scr.nextLine();
myString=myString.toUpperCase();
System.out.println("string in upper case : "+myString);
}catch(Exception ex){
return;}
}
}
Output:
Enter a string:hello
string in upper case : HELLO