Virtual methods & overriding in C++

A few months ago my friend asked me if I could explain a virtual methods in C++. How to use them, how to implement and why are these so important when programming? Today I am going to answer all of these questions. First of all, we use virtual methods during inheritance. We create a pointer of base … Continue reading Virtual methods & overriding in C++

Java – Inheritance

According to my latest post about Inheritance in C++, I am going to explain the same in Java. Let's go: We have to create class CFurniture in file named (here is the first difference ) and then: Then we create another class called CTable ( In main we have to write:

C++ Inheritance

While using OOP (Object Oriented Programming) we have to operate on classes, so we create our own class, for example class CFurniture: And then we create another class, which is strictly connected with CFurniture, e.g. CTable: In main() we are going to call the SetType() (to set) and GetType() (to get type) methods: You can see … Continue reading C++ Inheritance