Examveda

Correct way to define object of sample class in which C# code will work correctly is:
class abc
{
    int i;
    float k;
    public abc(int ii, float kk)
    {  
        i = ii;
        k = kk;
    }
}

A. abc s1 = new abc(1);

B. abc s1 = new abc();

C. abc s2 = new abc(1.4f);

D. abc s2 = new abc(1, 1.4f);

Answer: Option D


Join The Discussion

Related Questions on Classes and Objects in C Sharp