3 ms·
I hope they're not serious. Scanned it and realized they wrote the questions off the top of their head. Incorrectly. Question 5, Given the following code, what
by nrkn 15y ago
I hope they're not serious. Scanned it and realized they wrote the questions off the top of their head. Incorrectly.
Question 5, Given the following code, what is the value of e.ID?
Well, they're right that it won't compile, but not for the reasons given. First it's gonna choke on the missing semicolon in the Person constructor:
Person()
{
FirstName="";
LastName=""
}
Then, before it gets to the line they claim is problematic, it'll choke again, the Person constructor is private so you can't access it from Employee.
Question 9, what is wrong with the following code.
This isn't a property and won't compile:
public Size Size
{
return new Size(i,j);
}
Correct:
public Size Size
{
get { return new Size(i,j); }
}
Also, it's from 2007.
Edit: fixed spacing etc.