Well in Peters definition I take it as him saying that everything listed under public and private is a method. |
No. He's saying
functions listed under those things are methods. He explicitly uses the word function. Twice. So why would you decide that other things which aren't functions are also methods?
Your code snippet makes no sense. You define a public data member called random, but then define a function also called random. Did you mean to write the following?
1 2 3
|
public:
int random();// <- is this a method?
|
And then:
int x = 5; //<- and is this a method?
Well, does it satisfy Peter's definition? Is is a function? Is it a member of a class?
If you don't even know what a function is, I suggest you return to your textbook and go back to re-read the section on functions.
I would also like to know what an object is? |
Surely any textbook or tutorial can tell you this? Hell, a simple Google search should find you some answers.
We'll happily help you solve genuine answers. But asking us simply to re-type material that has already been written and is easily findable, is just lazy and rude.
EDIT: And why are you deleting the contents of your posts? It makes the thread look like nonsense, and ruins the value of this thread as something that can help other people learn too.