Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: Question regarding methods and classes Date: Sun, 23 Oct 2011 07:43:36 -0700 Organization: A noiseless patient Spider Lines: 34 Message-ID: References: <4ea389df$0$13444$9a566e8b@news.aliant.net> <4ea4177e$0$19700$9a566e8b@news.aliant.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 23 Oct 2011 14:43:40 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="28453"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/k+aJxInNJOao46sk8qv+hWDArn1gahxI=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <4ea4177e$0$19700$9a566e8b@news.aliant.net> Cancel-Lock: sha1:yt90x/FulfoCS4cI3Y0wmbkP8tU= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9115 On 10/23/2011 6:32 AM, Linus Flustillbe wrote: > I understand the concept of overloading methods... I haven't done much > Java in few years so I'm taking a refresher by going through the Java More on overloading: > Tutorial. What does adding the "static" modifier to the import > statement do? Since the methods in the rType class are already defined > as being static (only one instance no matter how many times the class is > instantiated ... see I read up on that) why do we need the modifier > except to make the code compile? Or is that the only reason.. because > Java needs it? By default "import" brings in class definitions, not the members of the class. So import helperClasses.rType; would import the class, and you'd have to use rType.isBetween( x, y, z); C.f. that link Peter gave you, which uses this style of static method access. "Import static" is a special import syntax that imports only the static members of rType, not the class definition, so that you can use its static methods and fields "bare," without a class name as a qualifier. It's a convenience for typing (and reading), nothing else.