Learn Java — object-oriented programming for apps, games, and more! 🚀
Java is a class-based, object-oriented programming language that is widely used in web, mobile, and desktop applications.
“Write once, run anywhere.”
Variables, types, and simple operations:
int age = 15;
String name = "Dyl";
System.out.println("Name: " + name);
System.out.println("Age: " + age);
Functions in Java are called methods:
public static String greet(String user) {
return "Hello, " + user + "!";
}
System.out.println(greet("Dyl"));
Java loops let you repeat tasks:
for(int i = 0; i < 5; i++) {
System.out.println("Loop " + i);
}
Type your Java code below and click “Run Code”.
Output will appear here...
*Simulated Java output (real compilation requires server-side setup)