Essay Database

Need an original paper?
Like us on Facebook in May and win FREE subscription to THOUSANDS high-quality essays and term papers
Like us on Facebook in May and win FREE subscription to THOUSANDS high-quality essays and term papers

Static vs. Virtual Methods

Date Submitted: 02/13/2004 10:42:51
Category: / Science & Technology
Length: 2 pages (490 words)
The definitions of static and virtual methods are below. You'll probably want to refer back to them several times: static methods: the default; if redefined by a descendant, parameter lists and type returned can differ at each definition; calls resolved at COMPILE-TIME virtual methods: virtual directive required in the method heading in the interface part; virtual method headings must be identical in the ancestor and in all descendant object types; calls resolved at RUN-TIME; objects …
Is this Essay helpful? Join now to read this particular paper
and access over 480,000 just like this GET BETTER GRADES
…safe to make a method a virtual method so that polymorphism can be used with late binding. So even though static methods use less memory and execution time than virtual methods, unless space and time efficiency are essential, your objects should use virtual methods instead of static methods. Why? Object types that define virtual methods are EXTENSIBLE. That is, you can add capabilites to a descendent object type without access to the ancestor's source statements.
Need a custom written paper? Let our professional writers save your time.