🔧 Tech notes 01 - Default Constructor and User-Defined Constructor in Java
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
I'm studying OOP using the Java How to Program Book. In exercise 4.19 - (Sales Commission Calculator) when I try to solve it. If we have two constructors
when you call one
of them, JVM
will ignore the other one
.
Check the pictures to know more.
1. case 1:
In the default constructor
I just initialized
this.rate = 0.09;
variable, but I didn't use this constructor
by the way!
2.case 2:
I did initialize
this.rate = 0.09;
with a non-zero value, if I didn't give it a value, the compiler will equal it to zero **
**Note: this is an opinion, I'm a student, if you have another answer for this case, please tell me! Thanks!
🔧 Constructor Overloading in Java
📈 21.51 Punkte
🔧 Programmierung
🔧 Constructor in Java
📈 21.51 Punkte
🔧 Programmierung
🔧 Day 12 Constructor in java:
📈 21.51 Punkte
🔧 Programmierung
🔧 Java Constructor
📈 21.51 Punkte
🔧 Programmierung
📰 How To Pin Notes In The Notes App In iOS 11
📈 17.94 Punkte
🖥️ Betriebssysteme
🍏 Standard Notes 3.138.4 - Encrypted notes app.
📈 17.94 Punkte
🍏 iOS / Mac OS
🔧 NoteYard - Piano Notes | Keyboard Notes
📈 17.94 Punkte
🔧 Programmierung
🔧 Notes on Notes
📈 17.94 Punkte
🔧 Programmierung
🍏 34 Notes About Math Notes
📈 17.94 Punkte
🍏 iOS / Mac OS
🍏 34 Notes About Math Notes
📈 17.94 Punkte
🍏 iOS / Mac OS