adplus-dvertising
frame-decoration

Question

Which is most appropriate comment on following class definition :
class Student 
{
    int a; 
    public : float a; 
};

a.

Error : same variable name can’t be used twice

b.

Error : Public must come first

c.

Error : data types are different for same variable

d.

It is correct

Answer: (a).Error : same variable name can’t be used twice

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which is most appropriate comment on following class definition :