Nguyễn Trần Mai Trang
New member
The correct way to implement a read only property add, in a math class is?
A.
B.
C.
D. None of the mentioned
A.
Code:
class math
{
int ad;
public int add
{
get
{
return ad;
}
}
}
Code:
class math
{
public int add
{
get
{
return ad;
}
}
}
Code:
class math
{
int ad;
public int add
{
get
{
return ad;
}
set
{
ad = value;
}
}
}