Fixing code to display a character from a string

Report a typo

You are given a Java program that is supposed to grab a certain character from a string and display it alongside a message in the console. However, this program is incomplete and contains three missing parts. Your task is to fill the blanks in the code to make it run correctly and print the specified character from the string 'Hello, User!'.

Fill in the gaps with the relevant elements
public class Main {
    public static void main([] args) {
        String myString = "Hello, User!";
        char myChar = myString.(7);
        String output = "Character at index 7 is: " + myChar;
        (output);
    }
}
System.out.printlnStringcharAt
___

Create a free account to access the full topic