Elance Exams Answers PDF file

-- PDF FILE --
Download PDF file of elance Zoho Creator Exam Answers

Why won't this code compile class A { private int i; public int P { get { return i; } set { i = value; } } public int get_P() { return i; } public void set_P(int i) { this.i = i; } }

In c# and VB.NET the class name must be more than one letter long
The line public void set_P(int i) { this.i = i; } is illegal because you are using the same variable name twice.
In C# and VB.NET properties are implemented as methods named get_XXX and set_XXX​​, so we cannot have the same methods with same parameter types twice. ​​
  • Follows us our servcies
  • Facebook icon
  • Linkedin icon
  • twitter icon
  • rss icon
  • social icon