Assign and print
After declaring variables, you assign values using the =
operator. Once assigned, you can print the values using System.out.println()
.
Give it a go!
Diese Übung ist Teil des Kurses
Introduction to Java
Anleitung zur Übung
- Create a
String
variablecreator
and assign"James Gosling"
to it. - Print the
creator
variable.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
class InfoAboutJava {
public static void main(String[] args) {
String language = "Java";
int yearOfOrigin = 1995;
// Create and assign the creator variable
String ____ ____ ____;
System.out.println(language);
System.out.println(yearOfOrigin);
// Print the creator of Java
System.out.println(____);
}
}