

MCQOPTIONS
Saved Bookmarks
1. |
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? Sample s1 = new Sample(); Sample s2 = new Sample(9, 5.6f); |
A. | Public Sample() { i = 0, j = 0.0f; } public Sample (int ii, Single jj) { i = ii; j = jj;} |
B. | Public Sample (Optional int ii = 0, Optional Single jj = 0.0f) { i = ii; j = jj; } |
C. | Public Sample (int ii; Single jj) { i = ii; j = jj; } |
D. | Sample s, |
Answer» B. Public Sample (Optional int ii = 0, Optional Single jj = 0.0f) { i = ii; j = jj; } | |