Biology, asked by Sakharam8449, 1 year ago

You have a class representing cat. Each cat can meow, purr, catch mice, and so on. When you create a new cat, what is it called?

Answers

Answered by shoaibahmad131
0

When we have class representing class representing cat and each cat can meow, purr, catch mice and so on, so when we create new cat, it would be an “instance”.  

An instance method is a method of an instantiated class.

A simple example might be this: You have a Class representing Cat. Each Cat can do some things - it can meow, purr, catch mice, and so forth. Each of those things is the same action no matter which cat does it, so the method is method of the class Cat. But each particular meowing, purring, or catching of mice is done by one particular cat, so it's an instance method.


Answered by Sidyandex
0

In case I already have a class representing a cat, and then the cat can also purr, meow, catch mice and so on, when I create a new cat, it will be called an instance where first I have to create a subprogram.

After that, the submethod will be implemented to create the cat.

After this, at the third phase, we will have subclass and finally, when we go on with making the new cat, that will be called a variable class.

Similar questions