how to create a new instance of a class in java code example
Example 1: java create new object
Car mycar = new Car();
Example 2: create instance object java
myCar = new Car();
Example 3: how to make an objec tjava
class Puppy() {
String name;
int age;
Puppy(String puppy_name, int puppy_age) {
name = puppy_name;
age = puppy_age;
}
public static void main(String[] args) {
Puppy rex = new Puppy("rex",4);
}
}