3 ms·
Timeline: Java 5 (2004) [code sample from the article]: public class Main { public static void main(String[] args) { Scanner scanner
by cbeach 1y ago
Timeline:
Java 5 (2004) [code sample from the article]:
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("What is your name? ");
String name = scanner.nextLine();
System.out.println("Hello, " + name);
}
}
Scala 2 (2006):
object Main extends App {
val name = readLine("What is your name? ")
println(s"Hello, $name")
}
Scala 3 (2021):
val name = readLine("What is your name? ")
println(s"Hello, $name")
Java (2025) [code sample from the article]:
void main() {
var name = IO.readln("What is your name? ");
IO.println("Hello, " + name);
}