Sep 13, 2024
public class Main {
public static void main(String[] args) {
System.out.println("Hello Java!");
}
}
int[] numbers = new int[3]; // Declares an array with 3 elements
if (condition) {
// code to execute if condition is true
} else {
// code to execute if condition is false
}
public class Cat {
String name;
void meow() {
System.out.println(name + " says meow!");
}
}
Cat myCat = new Cat();
myCat.name = "Whiskers";
myCat.meow();