class Sample
{
private int i;
public Single j;
private void DisplayData()
{
Console.WriteLine(i + " " + j);
}
public void ShowData()
{
Console.WriteLine(i + " " + j);
}
}
A. j cannot be declared as public.
B. DisplayData() cannot be declared as private.
C. DisplayData() cannot access j.
D. ShowData() cannot access to i.
E. There is no error in this class.
Answer: Option E
{
private int i;
public Single j;
private void DisplayData()
{
Console.WriteLine(i + " " + j);
}
public void ShowData()
{
Console.WriteLine(i + " " + j);
}
}
A. j cannot be declared as public.
B. DisplayData() cannot be declared as private.
C. DisplayData() cannot access j.
D. ShowData() cannot access to i.
E. There is no error in this class.
Answer: Option E