473,509 Members | 2,828 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static Methods In Interface

23 New Member
hello Guys I have a nice topic to discuss about,

Can we Declare a static methods in Interfaces?
when i have declared it, it gives a compile time error...

Can any one having any idea about this problem that why we are not facilitate with static methods in Interfaces?
Jun 29 '07 #1
1 1279
r035198x
13,262 MVP
hello Guys I have a nice topic to discuss about,

Can we Declare a static methods in Interfaces?
when i have declared it, it gives a compile time error...

Can any one having any idea about this problem that why we are not facilitate with static methods in Interfaces?
All methods in an interface are implicitly public, abstract, and never static.
You can declare a static interface inside an interface.
All variables in an interface are implicitly static, public and final.

You won't catch me with basics again today.
Jun 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2184
by: baylor | last post by:
In C#, an interface cannot mark any method as static. i'm told the ILASM supports it but i've never tested that Two questions. First, why? OK, i've heard the reason about interfaces being...
8
52740
by: Steven Livingstone | last post by:
Anyone able to explain to me why you cannot define an interface that can then be implemented using static methods? I understand the C# CLS states this, but just interested in the reasons behind...
33
3314
by: Chris Capel | last post by:
What is the rationale behind the decision not to allow abstract static class members? It doesn't seem like it's a logically contradictory concept, or that the implementation would be difficult or...
5
3955
by: Andy | last post by:
Why can't I create an interface and make its implementation static/shared? Is there some pattern that lets me work around this? Any explanation of why this is would be appreciated. This...
5
24194
by: TruongLapVi | last post by:
Hi, Why C# does not support Interface static member ? Some time I want implement NullObject Pattern: public interface INullObject { public static INullObject Null { get { return...
3
2781
by: bauscharln | last post by:
hoi, I just wanted to add a static method to my interface, but that's not allowed! Is there a reason for this??? (Yes, I could make an abstract base class, but that's not what I want, since I...
17
2330
by: Picho | last post by:
Hi all, I popped up this question a while ago, and I thought it was worth checking again now... (maybe something has changed or something will change). I read this book about component...
3
2296
by: =?Utf-8?B?TkVXMi5ORVQ=?= | last post by:
I have a static event declared in a C++ ref class, that can then be handled in a VB app. I'm trying to expose the static event through the interface that the C++ ref class implements so the VB app...
5
2356
by: dans | last post by:
Hi, I have recently started writing in C# on Linux using mono and come from a C++ background. I would like to create interfaces that expose methods for objects constructed using the singleton and...
1
279
by: kownacek | last post by:
Hello. I have some classes which resemble tables in a database. I'd like to create CRUD-like methods for each class, for example Create(), GetAll(), GetById(Guid id), DeleteById(Guid id), etc......
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7416
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7506
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5062
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4732
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
779
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.