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

C#

 
AnswerRe: The process cannot access the file because it is being used by another process. Pin
originSH3-Sep-07 22:29
originSH3-Sep-07 22:29 
QuestionSQL Connection String Problem Pin
Xmen Real 3-Sep-07 16:56
professional Xmen Real 3-Sep-07 16:56 
AnswerRe: SQL Connection String Problem Pin
Michael Sync3-Sep-07 17:33
Michael Sync3-Sep-07 17:33 
Questionsql checkedlistbox and insert statement Pin
falles013-Sep-07 16:53
falles013-Sep-07 16:53 
QuestionDrawing on controls Pin
udikantz3-Sep-07 16:45
udikantz3-Sep-07 16:45 
AnswerRe: Drawing on controls Pin
rah_sin3-Sep-07 22:23
professionalrah_sin3-Sep-07 22:23 
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 
This was a question on a students exam:

Shown was a static void main, and a second class, titled Punta.

namespace Test
{
class Test
{
static void Main(string[] args)
{
Punta punt = new Punta();
double bla = punt.Search();
}
}
class Punta
{
double Search()
{
return 5.0; //assume we calculated something here and found it
}
}
}

Question was: Is this code executable? (Exam) Answer: No
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?
And, how can you fix that, without changing the code of Punta-class.
The expected answer for the teacher was: An interface.
Followed by lines of code to make it accessible.

BUT... it did say, "you may NOT change the code of the class 'Punta'". But how is that some people say: If you use an interface, you're actually modifying the class. And some say, you aren't.
Which is it?



-- modified at 23:04 Wednesday 5th September, 2007
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 
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 

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.