0
Cat c=new cat(); c.cat;
what is the meaning of that code
2 Réponses
+ 1
your code is wrong. Correct : Cat c = new Cat();
I mean, the "Cat()" is a method, more precise it is the constructor (the single method in the class with the capital letter and with the name of the class).
c.cat has no meaning. I don't think you want the property of any cat to be named "cat". Maybe you want catName or catAge.
0
you create an Object from the Cat class.
Then you call the value cat in the the Cat class.