Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Errr..



A static method can be invoked from anywhere the class is visible. If the class is not explicitly specified, then it searches the enclosing scopes looking for a suitable match. Instance method require an object instance to invoke including an implicit 'this'. BTW, you _can_ invoke a static using an object instance, the class used is the class of the instance.

Don Bate
At 9:32 PM -0600 1/13/06, Michael Hall wrote:
On Jan 13, 2006, at 9:13 PM, Matt wrote:


You seem to be stating that a static method cannot be invoked from an instance method. Do you hold true to this statement? In this case, how would a static method ever be invoked? Would you please provide an example of this? This time, your example would be expected to fail compilation.

No I got it backwards a instance method can't be invoked from a static, like main. The other way a static method would be invoked would be from another static method, or a static initializer I think, not tested real recently.


Mike Hall        mikehall at spacestar dot net
http://www.spacestar.net/users/mikehall
http://sourceforge.net/projects/macnative



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


--
Don Bate               | Specializing in Consulting and Mentoring in
Bate Consulting, Inc   | Object-Oriented Technologies,
                       | Software Architecture, and Software Process
(972) 618-0208 voice
(972) 618-0216 fax
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Re: Java Swing and Quartz (From: Brian Foster <email@hidden>)
 >Errr.. (From: Bob Irving <email@hidden>)
 >Re: Errr.. (From: Michael Hall <email@hidden>)
 >Re: Errr.. (From: "Matt" <email@hidden>)
 >Re: Errr.. (From: Michael Hall <email@hidden>)
 >Re: Errr.. (From: "Matt" <email@hidden>)
 >Re: Errr.. (From: Michael Hall <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.