Question: Consider the following class: 1. Write its default constructor 2. Write a code to declare an object from this class using the default constructor public
Consider the following class:
1.Write its default constructor
2.Write a code to declare an
object from this class using the
default constructor
public class Dog {
String name;
String color;
void barking() {
}
void hungry() {
}
void sleeping() {
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
