Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2008 > C# 2008 aka C# 3.0
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #11 (permalink)  
Old May 24th, 2011, 09:54 AM
Authorized User
Points: 403, Level: 7
Points: 403, Level: 7 Points: 403, Level: 7 Points: 403, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Location: Kolkata, India
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Why static class is abstract??
__________________
Happy coding...

Arnab Roy Chowdhury.
  #12 (permalink)  
Old May 24th, 2011, 02:00 PM
Authorized User
 
Join Date: Mar 2011
Posts: 17
Thanks: 3
Thanked 0 Times in 0 Posts
Default

What do you want to achieve by inheriting a static class ? What are your specs ?
As for why static classes are abstract ? You can ask try asking in the MSDN forums.
  #13 (permalink)  
Old October 31st, 2011, 03:42 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The main reason that you cannot inherit a static class is that they are abstract and sealed (this also prevents any instance of them from being created).
So this:
Static class Foo { }

Compiles to this IL:
.class private abstract auto ANSI sealed beforefieldinit Foo
extends [mscorlib] System. Object
{
}
  #14 (permalink)  
Old October 31st, 2011, 04:28 AM
Authorized User
Points: 403, Level: 7
Points: 403, Level: 7 Points: 403, Level: 7 Points: 403, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Location: Kolkata, India
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Ok.. Thanks..
__________________
Happy coding...

Arnab Roy Chowdhury.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Static variables in Static Class JoinTTT BOOK: Professional ASP.NET 3.5 : in C# and VB ISBN: 978-0-470-18757-9 4 March 29th, 2009 06:08 PM
Using logging class as a static class punitw General .NET 0 August 14th, 2008 04:03 AM
static field with class instance prakash.suthar Java Basics 2 July 3rd, 2006 02:41 AM
static Class in ASP chafor ASP.NET 1.0 and 1.1 Basics 4 January 13th, 2006 10:58 AM
who destroy static variables(no instance of class) MikoMax J2EE 1 March 31st, 2004 08:01 AM



All times are GMT -4. The time now is 12:37 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.