- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
Which of the following statements is correct about the C#.NET code snippet given below?

class Sample
{
    private int i;
    public Single j;
    private void DisplayData()
    {
        Console.WriteLine(i + " " + j);
    }
    public void ShowData()
    {
        Console.WriteLine(i + " " + j);
    }
}

1.j cannot be declared as public.

2. DisplayData() cannot access j.

3.ShowData() cannot access to i.

4. There is no error in this class.

Posted Date:-2021-02-25 10:32:15


More MCQS Questions and answers

Search