Assign and print
Once you've created variables, you can assign values to them and display those values. This is a fundamental pattern you'll use throughout your programming journey. In this exercise, two variables have already been created for you: language and yearOfOrigin.
Este exercício faz parte do curso
Introduction to Java
Instruções do exercício
- Create a text variable called
creatorand assign"James Gosling"to it. - Print the
creatorvariable.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
class InfoAboutJava {
public static void main(String[] args) {
String language = "Java";
int yearOfOrigin = 1995;
// Create and assign the text variable creator
String ____ ____ ____;
System.out.println(language);
System.out.println(yearOfOrigin);
// Print the creator of Java
System.out.println(____);
}
}