QA blooper
-
public int val2 { get { return val2; } set { val2 = 10; } }
:rolleyes:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
-
public int val2 { get { return val2; } set { val2 = 10; } }
:rolleyes:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
Maybe there was a requirement to not use
const
? -
public int val2 { get { return val2; } set { val2 = 10; } }
:rolleyes:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
-
Maybe there was a requirement to not use
const
?No, the requirement was to create a public get/set property named Value2 for a private field named value2 and to use that property to set value2 to a value of 10 - but from outside the containing class..
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
-
I'm surprised this code compiles, as there is a circular reference in the getter.
You always obtain more by being rather polite and armed than polite only.
Yep, the compiler will let you run into a SO-exception without turning a hair :laugh:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
-
I'm surprised this code compiles, as there is a circular reference in the getter.
You always obtain more by being rather polite and armed than polite only.
Alas it does, I've lost many an hour to it :D
-
I'm surprised this code compiles, as there is a circular reference in the getter.
You always obtain more by being rather polite and armed than polite only.
-
public int val2 { get { return val2; } set { val2 = 10; } }
:rolleyes:
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
I strongly suspect that nugget of joy was written by someone who typically writes in JavaScript. Or maybe a cat walking across the keyboard. Any other answer would be insane...
-
I strongly suspect that nugget of joy was written by someone who typically writes in JavaScript. Or maybe a cat walking across the keyboard. Any other answer would be insane...
Or someone who has no idea what he is doing and is playing games in class and not paying attention to the professor.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???