Which of the following elements can an interface NOT contain?

Posted on 2007-03-31
Last Modified: 2008-01-09
Which of the following elements can an interface NOT contain?
Constants, Constructors, Static Members or all of them?
Question by:mabtahi
  • 3
  • 2
LVL 86

Expert Comment

ID: 18831039
None of the above is ruled out (from a perspective of valid and compilable C++ code), yet neither of them makes sense (except enum constants).
LVL 37

Accepted Solution

gregoryyoung earned 125 total points
ID: 18831174
is this geared towards C# or C++?

The most interesting of these in C# is static methods which are actually supported bythe CLR but there is no language support for them. Beyond that possible exception allare not allowed.
LVL 15

Expert Comment

ID: 18833480
Why does that sound like a test/homework question?
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

LVL 86

Expert Comment

ID: 18938851
Err: Why did you choose a comment as an answer that does not even refer to the question?
LVL 37

Expert Comment

ID: 18941457
umm jkr, I certainly did .. I answerred it for C# it being that this is in the C# TA.

None are allowed in C# but the CLR supports static methods on interfaces.
LVL 86

Expert Comment

ID: 18949736
OK, don't know much about C#, so I misunderstood your comment, sorry. But in that case, we both are correct.

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now