Hello again
I find that most eccentric. If a constructor doesnât return any return type, then, strictly speaking, doesnât that mean that a constructor cannot be called a âfunctionâ? I thought it was correct to call a constructor a function but, as I understand it, in computer programming terminology, a function must have, among other things, a single defined output type (its return type) else, by definition, it is not a âfunctionâ.
Until now I had always just assumed that the purpose of the keyword ânewâ was only to remind the reader that a ânewâ instance of an object of the class will be returned as a result of the constructor being executed. But, in our example, as ânew returns an instance of the JPanel classâ then does that mean that the keyword ânewâ represents a function call - like a call to a method that happens to return an instance of an object of the JPanel class? If so, then what would its âargumentsâ be? I find this whole thing most eccentric.
