in reply to Re: OO best practice basic questions
in thread OO best practice basic questions
Thanks, i've added the uneven list test into my constructor.
When using the obj_count, is there a way to make it a method of the object? I don't know if that makes sense but in order to call it i guess i have to use Numbers::get_count() for example. But then if i attach it to each object i'm guessing the object will only have the value at that time, so i'd have to be sure to only check the value in the last object created. Is that right?
Another question i have is with the value "result"
It is an internally created value. So do i initialise the value in the constructor? Or the first time it is used? For example if i call the method add_nums, the result is stored in result. Should that variable already exist?
What we be an example of a destructor?
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: OO best practice basic questions
by choroba (Cardinal) on Aug 28, 2014 at 11:37 UTC |