0

Cat c=new cat(); c.cat;

what is the meaning of that code

19th Jun 2017, 9:49 AM
R Prathibha
R Prathibha - avatar
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.
19th Jun 2017, 12:25 PM
Claudiu Stefan Haidu
Claudiu Stefan Haidu - avatar
0
you create an Object from the Cat class. Then you call the value cat in the the Cat class.
19th Jun 2017, 10:02 AM
Limitless
Limitless - avatar