Loading

Quipoin Menu

Learn • Practice • Grow

java / Java Constructor
exercise

Exercise Number: 1

Question:

Write a Java program to create a class called Cat with instance variables name and age. Implement a default constructor that initializes the name to "Unknown" and the age to 0. Print the values of the variables.