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.
Latihan ini adalah bagian dari kursus
Introduction to Java
Petunjuk latihan
- Create a text variable called
creatorand assign"James Gosling"to it. - Print the
creatorvariable.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
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(____);
}
}