create in java code example
Example 1: 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);
}
}
Example 2: create object and call method in java
MyClass **insert_name** = new MyClass();
insert_name.**method_name**();