Tim Driven Development | Test until the fear goes away
A method declares executable code that can be invoked, passing a fixed number of values as arguments.
A constructor is used in the creation of an object that is an instance of a class (§12.5, §15.9).
Constructors are invoked by class instance creation expressions (§15.9), by the conversions and concatenations caused by the string concatenation operator + (§15.18.1), and by explicit constructor invocations from other constructors (§8.8.7). Access to constructors is governed by access modifiers (§6.6), so it is possible to prevent class instantiation by declaring an inaccessible constructor (§8.8.10).
Cody Kidwell wrote:In addition I found this that may contradict the other links I posted.
From https://docs.oracle.com/javase/specs/jls/se9/html/jls-8.html#jls-8.4
A method declares executable code that can be invoked, passing a fixed number of values as arguments.
Cody Kidwell wrote:I've been finding it hard to find concrete evidence counter what is said on this post ...
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
Consider Paul's rocket mass heater. |