+ 6

What is the difference between an-arg constructor, and default constructor??

java construcors

10th Nov 2017, 5:33 PM
Sara Hammadeh
Sara Hammadeh - avatar
5 Réponses
+ 8
They are the same. When an object is instantiated if has no constructor declared Java creates an empty (default) constructor with no argumentsولمعلومات اكتر دخلي على غوغل😉
10th Nov 2017, 5:50 PM
Firas Nassif Makki
Firas Nassif Makki - avatar
+ 8
a constructor with arguments can be used to initialize some variables Example: class myClass { int x; int y; public myClass(int newX,int newY){ this.x = newX; this.y = newY; } }
10th Nov 2017, 7:52 PM
David Akhihiero
David Akhihiero - avatar
+ 4
https://www.tutorialspoint.com هاد الموقع فيو كل شي بدك ياه عن لغات البرمجة مع مراجع
14th Nov 2017, 5:50 AM
Firas Nassif Makki
Firas Nassif Makki - avatar
+ 2
شفت غوغل, شي يقول نفس الشي وشي لا لهيك سألت :)
10th Nov 2017, 5:56 PM
Sara Hammadeh
Sara Hammadeh - avatar
+ 2
default constrictor كيكون بدون arguments و ما شي ضروري ديفينيه هو كاين كاين، غير الى ديفينيتي شي constrictor اخر ب args، ديك ساعة الى مازالة محتاجة constructif sans args، ضروري تكتبيه
22nd Nov 2017, 10:27 PM
M'hamed Hicham RAHIMI
M'hamed Hicham RAHIMI - avatar