A couple of tasks ago, students at the secret CodeGym center created the class Cat. Now it's time to actually create some cats in the image and likeness of the Cat class, or rather using the class as a pattern. There should be three cats. Breathe life (or specific data) into this trio.
The Three "Muscateers"
- 2
Locked
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Joshua Swigut
31 March 2020, 01:35
I don't understand why we have a public static class that identifies all the variables and then a public class with basically the same thing. It seems redundant but I'm sure I'm just missing the bigger picture.
0
Brandon Leirer
2 June 2020, 19:15
I've been trying to figure this out as well. I don't think the public Cat is a class though. It looks like a method used to assign all of this data into the private class instance variables. Which....sounds exactly like a set(). So I am not sure why this isn't worded as:
public setCat(String name, int age, int weight, int strength) {
Unless I am getting this totally confused.
0
ъуъ
25 September 2020, 09:53
It's not a class (the 2nd one), it's a constructor
0