Click here to Skip to main content
16,006,442 members
Home / Discussions / C#
   

C#

 
GeneralRe: why are classes sealed? Pin
Nish Nishant24-Dec-02 11:23
sitebuilderNish Nishant24-Dec-02 11:23 
GeneralRe: why are classes sealed? Pin
Christian Graus24-Dec-02 12:42
protectorChristian Graus24-Dec-02 12:42 
GeneralRe: why are classes sealed? Pin
Marc Clifton24-Dec-02 14:09
mvaMarc Clifton24-Dec-02 14:09 
GeneralRe: why are classes sealed? Pin
Christian Graus24-Dec-02 14:18
protectorChristian Graus24-Dec-02 14:18 
AnswerRe: why are classes sealed? Pin
James T. Johnson24-Dec-02 15:30
James T. Johnson24-Dec-02 15:30 
GeneralRe: why are classes sealed? Pin
JasonSmith25-Dec-02 16:04
JasonSmith25-Dec-02 16:04 
GeneralRe: why are classes sealed? Pin
James T. Johnson26-Dec-02 10:35
James T. Johnson26-Dec-02 10:35 
AnswerRe: why are classes sealed? Pin
James T. Johnson26-Dec-02 10:40
James T. Johnson26-Dec-02 10:40 
Marc Clifton wrote:
Specifically, why are classes like Point and String sealed?

Jason mentioned something that got me to remember another reason for sealing classes. JIT optimizations when dealing with virtual methods Wink | ;-)

If you have a virtual method in a class and you seal one of its child classes the JIT can produce code to call the child class' implementation instead of going to a vtable approach that would otherwise be needed.

It still needs to rely on the vtable if the variable is of the parent class type, but when you specify the child class it isn't needed.

Sorry of that last paragraph didn't make sense, I couldn't think of a better way of describing it Frown | :(

James

"The elastic retreat rings the close of play as the last wave uncovers
the newfangled way.
But your new shoes are worn at the heels and
your suntan does rapidly peel and
your wise men don't know how it feels to be thick as a brick."
"Thick as a Brick" from Thick as a Brick, Jethro Tull 1972

GeneralRe: why are classes sealed? Pin
Marc Clifton26-Dec-02 10:41
mvaMarc Clifton26-Dec-02 10:41 
QuestionHow to call GetIPictureFromPicture(Image image) method using C#. Pin
sns24-Dec-02 2:26
sns24-Dec-02 2:26 
AnswerRe: How to call GetIPictureFromPicture(Image image) method using C#. Pin
sns25-Dec-02 20:25
sns25-Dec-02 20:25 
Generalpoor but trying Pin
GaryR24-Dec-02 1:24
GaryR24-Dec-02 1:24 
GeneralRe: poor but trying Pin
TigerNinja_24-Dec-02 2:56
TigerNinja_24-Dec-02 2:56 
GeneralRe: poor but trying Pin
GaryR24-Dec-02 13:31
GaryR24-Dec-02 13:31 
GeneralPrinting Crystal reports Pin
sharon23-Dec-02 21:35
sharon23-Dec-02 21:35 
GeneralRe: Printing Crystal reports Pin
sharon25-Dec-02 21:42
sharon25-Dec-02 21:42 
General[URGENT PLEASE] Audio Library Pin
Jassim Rahma23-Dec-02 21:11
Jassim Rahma23-Dec-02 21:11 
GeneralRe: [URGENT PLEASE] Audio Library Pin
James T. Johnson23-Dec-02 21:28
James T. Johnson23-Dec-02 21:28 
GeneralRTL PrintDocument Pin
Jassim Rahma23-Dec-02 9:59
Jassim Rahma23-Dec-02 9:59 
GeneralRichEditBox Pin
Dave Kerr23-Dec-02 3:50
Dave Kerr23-Dec-02 3:50 
GeneralRe: RichEditBox Pin
leppie23-Dec-02 12:12
leppie23-Dec-02 12:12 
GeneralRe: RichEditBox Pin
Dave Kerr23-Dec-02 13:07
Dave Kerr23-Dec-02 13:07 
GeneralRe: RichEditBox Pin
leppie23-Dec-02 13:32
leppie23-Dec-02 13:32 
GeneralRe: RichEditBox Pin
peter271323-Dec-02 23:57
peter271323-Dec-02 23:57 
GeneralRe: RichEditBox Pin
Dave Kerr24-Dec-02 3:06
Dave Kerr24-Dec-02 3:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.