Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikibooksThe Free Textbook Project
Search

Object Oriented Programming/Superclasses

From Wikibooks, open books for an open world
<Object Oriented Programming

Superclasses are the parents of subclasses.[1] In relationships between two objects, a superclass is the name given to the class that passes down it's 'traits'(language entities.)[2] An example of a superclass would be an object like 'car' which would hold information like, make, model, mileage etc. An example of a Superclasses's format can be found below.

public class Person{}

Virtual methods

[edit |edit source]

From the wikipedia page on inheritence:"If the superclass method is a virtual method, then invocations of the superclass method will be dynamically dispatched. Some languages require that methods be specifically declared as virtual (e.g. C++), and in others, all methods are virtual (e.g. Java). An invocation of a non-virtual method will always be statically dispatched (i.e. the address of the function call is determined at compile-time). Static dispatch is faster than dynamic dispatch and allows optimisations such as inline expansion."[3]


References

[edit |edit source]
  1. https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)
  2. https://www.thoughtco.com/what-is-inheritance-2034264
  3. https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)
Subclasses
Polymorphism
Retrieved from "https://en.wikibooks.org/w/index.php?title=Object_Oriented_Programming/Superclasses&oldid=3797765"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp