Import java.util.scanner;//write Code hereclass dog{string breed,color;int weight;} Class Spotteddog extends Dog{private String spotcolor; Spotteddog (String a,int b,string c,string d) {breed=a;weight=b;color=c;spotcolor=d;} void Showbreed () {System.out.println (breed);} void Spotinfo () {System.out.println (Spotcolor);}} Class Unspotteddog extends Dog{unspotteddog (String a,int b,string c) {breed=a;weight=b;color=c;} void Showbreed () {System.out.println (breed);}} public class Main {public static void main (string[] args) {Scanner scan = new Scanner (system.in); String str1 = Scan.next (); int age1 = Scan.nextint (); String str2 = Scan.next (); String STR3 = Scan.next (); String STR4 = Scan.next (); int age2 = Scan.nextint (); String STR5 = Scan.next (); Spotteddog redspot = new Spotteddog (Str1,age1, str2, STR3); Unspotteddog rover = new Unspotteddog (STR4, Age2, STR5); Redspot.showbreed (); Redspot.spotinfo (); Rover.showbreed ();}}
Java experimental Questions 3_5_ Lindaru equalities station