Question: /* HeiferGenerator.java*/ public class HeiferGenerator { public static Cow[] getCows() { if ( cows == null) { cows = new Cow[ cowImages .length]; for (int
![/* HeiferGenerator.java*/ public class HeiferGenerator { public static Cow[] getCows() {](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3dbc2ad8b8_53866f3dbc24401b.jpg)
/* HeiferGenerator.java*/
public class HeiferGenerator { public static Cow[] getCows() { if (cows == null) { cows = new Cow[cowImages.length]; for (int index = 0; index cows.length; index++) { cows[index] = new Cow(cowNames[index]); cows[index].setImage(quoteLines + cowImages[index]); } } return cows; } private static String[] cowNames = { "heifer", "kitteh" }; private static String quoteLines = " \\ " + " \\ " + " \\ "; private static String[] cowImages = { " ^__^ " + " (oo)\\_______ " + " (__)\\ )\\/\\ " + " ||----w | " + " || || ", " (\"`-' '-/\") .___..--' ' \"`-._ " + " ` *_ * ) `-. ( ) .`-.__. `) " + " (_Y_.) ' ._ ) `._` ; `` -. .-' " + " _.. `--'_..-_/ /--' _ .' ,4 " + " ( i l ),-'' ( l i),' ( ( ! .-' " }; private static Cow[] cows = null; }![if (cows == null) { cows = new Cow[cowImages.length]; for (int index](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3dbc35f8dc_53866f3dbc2ded2c.jpg)
![= 0; index cows.length; index++) { cows[index] = new Cow(cowNames[index]); cows[index].setImage(quoteLines +](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3dbc3db845_53966f3dbc389606.jpg)
In java 8. Paste the code for Cowsay.java and Cow.java
Specification Students will construct two classes: a driver class with a main() entry point (Cowsay) and a data class (Cow). Note that HeiferGenerator.java is provided for you; you code must use this class to create the cow objects. All attributes /methods must be private unless noted in the specification
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
