All Questions

Tagged with
Filter by
Sorted by
Tagged with
-2
votes
2answers
103 views

C# Static & Constructor Logic [closed]

I learn C# and try to understand the logic between static and Constructor right now. One thing I need ask you about an example which I will give at below. (please ignore the quality of code or how ...
-4
votes
1answer
166 views

Inheritance of Constructors from parent into child class [closed]

Is the Default Constructor of Super or Parent class Can be Inherited into Child class ?
0
votes
6answers
647 views

why can't class directly take arguments instead of using a constructor?

I referred this page for understanding about constructors in Java: http://www.javatpoint.com/constructor So, I pretty much got it as in my own words: constructor has no return value and is used to ...
8
votes
5answers
53k views

Why is there no default constructor generated if you define an explicit constructor?

class Employee{ String name; int id; //No explicit constructors } Now I can invoke the following statement: Employee e1 = new Employee(); With the above code, the compiler will provide ...
5
votes
6answers
2k views

Should all classes have a default constructor as part of good coding convention

From the texts I have read so far, the conventions talk about organizing constructors, starting with the default, if any. I am wondering, should all classes have a default constructor anyway. This ...