I didn't want to take this title, but I decided to use it considering Seo issues. The difference between override and new can be found in many other blogs. Here I will give you a rough list:
Override overwrites the virtual method, so there is only the method after rewriting;
New hides the method of the base class. The method of the base class and the method of the current class are hidden at the same time.
Here I want to express the concept of hiding, rewriting, and overloading in Object-Oriented objects. These concepts are often mentioned when we discuss object-oriented.
Hide: New
Rewrite: override
Overload: in fact, it is a method of multiple implementation methods, but the method name is the same
Public class transport
{
Public Transport (){}
Public Virtual void go (){}
Public Virtual void go (Road ){}
}
Public class car: Transport
{
Public override void go ()
Public new void go (Road ){}
}
You can take a closer look at the go method, as mentioned in the above three forms. After reading this, you should know how to express the object orientation hiding, rewriting, and overloading.
-- = Happy reading = --
Google Tag: overrid, new, rewrite, reload, hide