Question: If Sample class has a Length property with get accessor then which of the following statements will work correctly?

Options

A : Sample m = new Sample(); m.Length = 10 ;

B : Sample m = new Sample(); m.Length = m.Length + 20 ;

C : Sample m = new Sample(); int l; l = m.Length;

D : Sample.Length = 20;

Click to view Correct Answer

Previous || Next

Properties - General Questions more questions

Which of the following statements are correct?

If Sample class has a Length property with get and....

Which of the following is the correct way to implement....

A property can be declared inside a namespace or a....

If a Student class has an indexed property which is....

An Account class has a property called accountNo and acc....

Suppose a Student class has an indexed property. This property....

Which of the following statements is correct about properties used....

Which of the following is the correct way to implement....

Which of the folowing does an indexer allow to index....

Attributes - General Questions more Online Exam Quiz

Inheritance - General Questions

Interfaces - General Questions

Namespaces - General Questions

Operators - General Questions

Polymorphism - General Questions

Structures - General Questions

Advanced SQL - General Questions

Data and Database Administration - General Questions

Database Design Using Normalization - General Questions

Database Processing for BIS - General Questions