What\'s the difference between the following two declarations?
virtual void calculateBase() = 0;
virtual void calculateBase();
I read the fir
In Java
virtual void calculateBase() = 0;
would be
abstract void calculateBase();
and
virtual void calculateBase();
would be
void calculateBase();
To be perfectly clear,
void calculateBase();
in C++, is "the same" as
final void calculateBase();
in Java. That is, final is "default" in C++. There is an exception to this rule however. When subclassing a class with a virtual method and reimplementing it without using the virtual keyword, the method in the subclass will not be final.
Basically, when inheriting, you are compelled to override the first one, and are allowed to override the second one.
Coming from Java, don't you?