B
Blue Ocean
My c++ text tells me that I should define methods this way:
class Stack
{
int method(double t);
Stack(int s);
...
}
int Stack::method(double t)
{
/* behavior */
}
but my experience with Java tells me that this way is better:
class Stack
{
int method(double t)
{
/* behavior */
}
Stack(int s)
{
/* behavior */
}
}
Which way do you use? Should I use the first or the second? I'd
rather develop good habits as I teach myself C++ rather than have to
go back and fix bad ones later. Thank you in advance for the help.
class Stack
{
int method(double t);
Stack(int s);
...
}
int Stack::method(double t)
{
/* behavior */
}
but my experience with Java tells me that this way is better:
class Stack
{
int method(double t)
{
/* behavior */
}
Stack(int s)
{
/* behavior */
}
}
Which way do you use? Should I use the first or the second? I'd
rather develop good habits as I teach myself C++ rather than have to
go back and fix bad ones later. Thank you in advance for the help.