Skip to Main Content
Software Essentials
book

Software Essentials

by Adair Dingle
July 2014
Intermediate to advanced content levelIntermediate to advanced
436 pages
12h 27m
English
Chapman and Hall/CRC
Content preview from Software Essentials
Behavioral Design 191
“virtual” with “override” claries the intent of class design, and is illus-
trated in Example 7.6. e class hierarchy in Example 7.6 is the same as
that in Example 7.5 except that it is written in C#.
Example 7.6: C# Virtual Functions Tagged and then Overridden
// C# class design – tagged function calls dynamically bound
// redefined functions must be labeled ‘override’
class FirstGen
{ protected int level;
public Gen(int a = 100, int b = 1000)
{ level = 1; }
public virtual int simple(int x, int y)
{ return x + y; }
}
class SecondGeb: FirstGen
{ public SecondGen(int a = 100, int b = 1000): base(a,b)
{ level = 2; }
public override int simple(int x, int y)
{ return x * y; }
public virtual int expand(int ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Software Architect’s Handbook

Software Architect’s Handbook

Joseph Ingeno
Economics-Driven Software Architecture

Economics-Driven Software Architecture

Ivan Mistrik, Rami Bahsoon, Rick Kazman, Yuanyuan Zhang
Software Architect Bootcamp

Software Architect Bootcamp

Raphael Malveau, Ph.D. Thomas J. Mowbray

Publisher Resources

ISBN: 9781439841204