The Correct Way Of Defining Constructor Of The Given Class As #198
The correct way of defining constructor of the given class as and when objects of classes are created is:</p> <pre><code class="language-csharp"> maths s1 = new maths(); maths s2 = new maths(5, 5.4f);</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Classes - Constructors in Class - Quiz No.1.
The correct way of defining constructor of the given class as and when objects of classes are created is:
maths s1 = new maths(); maths s2 = new maths(5, 5.4f);
public maths(int pp, single tt) { p = pp; t = tt; }
sample s;
public sample() { p = 0; t = 0.0f; } public sample(int pp, single tt) { p = pp; t = tt; }
s = new sample();