IndiaBIX
IndiaBIX
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

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);

  • Home
  • Computer Science & Engineering
  • C# Programming Questions and Answers
  • Constructors- General Questions
  • Discuss - 1025
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;
[E]. s = new Sample();

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
Workspace Report
Leave a Comment

Computer Science & Engineering :: C# Programming Questions and Answers : More Exercises

  • .NET Framework - General Questions
  • Control Instructions - General Questions
  • Functions and Subroutines - General Questions
  • Constructors- General Questions
  • Arrays - General Questions
  • Structures - General Questions
  • Properties - General Questions
  • Exception Handling - General Questions
  • Interfaces - General Questions
  • Delegates - General Questions
  • Generics - General Questions
  • Datatypes - General Questions
  • Operators - General Questions
  • Classes and Objects - General Questions
  • Inheritance - General Questions
  • Strings - General Questions
  • Enumerations - General Questions
  • Namespaces - General Questions
  • Polymorphism - General Questions
  • Collection Classes - General Questions
  • Attributes - General Questions

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2023

Admit Card

Admit Card 2023

Answer Key

Answer Key 2023
copyright
Privacy Policy
© 2025 IndiaBIX. All Rights Reserved.

Report