// The blueprint
class Dog {
String name;
void bark() {
System.out.println(name + " says woof!");
}
}
public class Main {
public static void main(String[] args) {
// Two independent objects from the same class
Dog first = new Dog();
first.name = "Rex";
Dog second = new Dog();
second.name = "Bella";
first.bark(); // Rex says woof!
second.bark(); // Bella says woof!
}
}