2_3_Assignment_Write_a_Class.docx.docx - Ashley Allen IT-145-X6831 Found in App Development 20EW6 July 2020 Dog.java public class Dog String type String

2_3_Assignment_Write_a_Class.docx.docx - Ashley Allen...

This preview shows page 1 - 3 out of 3 pages.

Ashley Allen IT-145-X6831 Found in App Development 20EW6 July 2020
Image of page 1
Dog.java public class Dog{ String type; String breed; String name; String topTrick; Dog(String type, String breed, String name){ this.type = type; this.breed = breed; this.name = name; } public void setTopTrick(String topTrick) { this.topTrick = topTrick; } public String toString(){ String temp = "\nDOG DATA\n"+name+" is a "+breed+", a "+type+" dog. \nThe top trick is : "+topTrick+"."; return temp; } } Corgi.java public class Corgi extends Dog{ int weight; int age;
Image of page 2
Image of page 3

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture