Re: Beginner question referring to an object in a class from within method in that class

Peter Dow <[email protected]> Fri, 28 Jul 2023 21:08:36 -0700
Newsgroups gmane.comp.lang.as400.java
Message-ID <[email protected]>
James,

Almost missed this!  Thanks once again; I'm learning a lot here.

A constructor is not a method.  Does it work like a method, but is only 
invoked by using the "new" keyword? Can it have any parms? Like

foo = new Bar(aParm); ?


And classes don't always have to have a constructor, right?


On 7/28/2023 4:50 PM, James H. H. Lampert via JAVA400-L wrote:
>
> (Oh, and a constructor is not a method; it's a constructor, sort of 
> the way the King is not a subject, he's the King. [Apologies to Ben 
> Jonson.] And methods don't have constructors; classes have them.) 
-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.