Click here to Skip to main content
15,890,741 members
Home / Discussions / C#
   

C#

 
GeneralRe: Drawing on controls Pin
udikantz10-Sep-07 14:50
udikantz10-Sep-07 14:50 
QuestionInterface does not alter class, or does it? [modified] Pin
mizitras3-Sep-07 15:09
mizitras3-Sep-07 15:09 
AnswerRe: Interface does not alter class, or does it? Pin
PIEBALDconsult3-Sep-07 17:11
mvePIEBALDconsult3-Sep-07 17:11 
GeneralRe: Interface does not alter class, or does it? Pin
Urs Enzler3-Sep-07 22:31
Urs Enzler3-Sep-07 22:31 
GeneralRe: Interface does not alter class, or does it? Pin
PIEBALDconsult4-Sep-07 4:59
mvePIEBALDconsult4-Sep-07 4:59 
GeneralRe: Interface does not alter class, or does it? Pin
Urs Enzler4-Sep-07 5:54
Urs Enzler4-Sep-07 5:54 
AnswerRe: Interface does not alter class, or does it? Pin
PIEBALDconsult4-Sep-07 5:03
mvePIEBALDconsult4-Sep-07 5:03 
AnswerRe: Interface does not alter class, or does it? [modified] Pin
Dave Kreskowiak4-Sep-07 5:56
mveDave Kreskowiak4-Sep-07 5:56 
mizitras wrote:
Question was: Is this code executable? (Exam) Answer: No


Correct, it won't even compile.


mizitras wrote:
Q for codeproject: CAN you compile, link and execute wrong code like this? Or is the only way to do so by supressing warnings and errors from the compiler?

Question 2 was: If it's not executable (which was assumed you've noticed), the question was: Why?


You can suppress warnings, not the errors. No, you still won't be able to compile this thing since the "double void Search()" will confuse the compiler. It won't make any assumptions about what you really mean here. You cannot have two return types.


mizitras wrote:
And, how can you fix that, without changing the code of Punta-class.


You can't. The Punta class MUST be changed to specify a single return type for the Search method. Also, since the default protection level is private, you must specify the Search method as public or internal for it to be seen outside the Punta class.

An interface will NOT fix this problem since interfaces do not modify a class. Interfaces specify the methods that an implementing class must define. The class must still be modified to tell it which interface it's implementing. Either way, the Punta class must be modified in order for it to be fixed.



-- modified at 12:04 Tuesday 4th September, 2007

A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Interface does not alter class, or does it? Pin
mizitras5-Sep-07 17:06
mizitras5-Sep-07 17:06 
QuestionRound window and change the size and no more round Pin
AghaKhan3-Sep-07 14:44
AghaKhan3-Sep-07 14:44 
QuestionAdding onclick event to class Pin
DanB19833-Sep-07 10:04
DanB19833-Sep-07 10:04 
AnswerRe: Adding onclick event to class Pin
Christian Graus3-Sep-07 10:06
protectorChristian Graus3-Sep-07 10:06 
AnswerRe: Adding onclick event to class Pin
Ravi Bhavnani3-Sep-07 10:12
professionalRavi Bhavnani3-Sep-07 10:12 
AnswerRe: Adding onclick event to class Pin
Luc Pattyn3-Sep-07 10:23
sitebuilderLuc Pattyn3-Sep-07 10:23 
GeneralRe: Adding onclick event to class Pin
DanB19833-Sep-07 10:25
DanB19833-Sep-07 10:25 
QuestionwebBrowser control problem Pin
Opa Knack3-Sep-07 8:42
Opa Knack3-Sep-07 8:42 
QuestionSpam filter using Artificial Immune System Pin
starline3-Sep-07 7:36
starline3-Sep-07 7:36 
AnswerRe: Spam filter using Artificial Immune System Pin
Paul Conrad3-Sep-07 7:46
professionalPaul Conrad3-Sep-07 7:46 
GeneralRe: Spam filter using Artificial Immune System Pin
starline3-Sep-07 8:03
starline3-Sep-07 8:03 
GeneralRe: Spam filter using Artificial Immune System Pin
Paul Conrad3-Sep-07 8:26
professionalPaul Conrad3-Sep-07 8:26 
AnswerRe: Spam filter using Artificial Immune System Pin
Pete O'Hanlon3-Sep-07 9:00
mvePete O'Hanlon3-Sep-07 9:00 
GeneralRe: Spam filter using Artificial Immune System Pin
starline9-Sep-07 0:51
starline9-Sep-07 0:51 
QuestionAssign a value Pin
Assaf823-Sep-07 7:08
Assaf823-Sep-07 7:08 
AnswerRe: Assign a value Pin
Urs Enzler3-Sep-07 8:34
Urs Enzler3-Sep-07 8:34 
Questionborder for mdiparent - please help me! [modified] Pin
shai sherman3-Sep-07 7:05
shai sherman3-Sep-07 7:05 

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.