Question: Which of the following is the correct way to define the constructor(s) of the Sample class if we are to create objects as per the C#.NET code snippet given below?

Options

A : public Sample() { i = 0 ; j = 0.0 f; } public Sample ( int ii, Single jj) { i = ii; j = jj; }

B : public Sample (Optional int ii = 0 , Optional Single jj = 0.0 f) { i = ii; j = jj; }

C : public Sample ( int ii, Single jj) { i = ii; j = jj; }

D : Sample s;

Click to view Correct Answer

Previous || Next

Constructors - General Questions more questions

Which of the following statements is correct?

Which of the following statements is correct about the C#.NET....

Which of the following ways to create an object of....

Which of the following statements are correct about static functions?

Which of the following statements is correct about constructors?

In which of the following should the methods of a....

Can static procedures access instance data?

Which of the following statements are correct about constructors in....

How many times can a constructor be called during lifetime....

Is it possible to invoke Garbage Collector explicitly?

Attributes - General Questions more Online Exam Quiz

Attributes - General Questions

Classes and Objects - General Questions

Collection Classes - General Questions

Datatypes - General Questions

Delegates - General Questions

.NET Framework - General Questions

Enumerations - General Questions

Exception Handling - General Questions