In a basic Java program, you need to display information about various types of variables. Fill the blanks in the provided code to properly initialize an integer, and a single character, and then output these values, along with a predefined string, to the console.
Basic literals: numbers, strings and characters
Initializing and displaying various variables
Report a typo
Fill in the gaps with the relevant elements
public class Main {
public static void main([] args) {
numberExample = 123;
characterExample = 'J';
String stringExample = "Java Beginner";
System.out.println("Number: " + numberExample);
System.out.println("Character: " + characterExample);
System.out.println("String: " + stringExample);
}
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.