first commit

This commit is contained in:
Jose Caban
2025-06-07 01:59:34 -04:00
commit 388ac241f0
3558 changed files with 9116289 additions and 0 deletions

32
CS1322/t3/Animal.java Normal file
View File

@@ -0,0 +1,32 @@
public class Animal{
public String name;
public static int animalCount=0; //A count of all the animals created
public Animal(){
this("Bob");
}
public Animal(String name){
this.name=name;
animalCount++;
}
public void eat(){
System.out.println("Yummy");
}
public void speak(){
System.out.println("I am an Animal. My name is "+ this.name);
}
public String toString(){
return "I am an animal named " + this.name;
}
}