Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9104

Re: Question regarding methods and classes

Date 2011-10-23 06:14 +0100
From Patricia Shanahan <pats@acm.org>
Newsgroups comp.lang.java.programmer
Subject Re: Question regarding methods and classes
References <4ea389df$0$13444$9a566e8b@news.aliant.net> <F_GdndVSBOITED7TnZ2dnUVZ_jidnZ2d@posted.palinacquisition>
Message-ID <SJidnVhi34siPz7TnZ2dnUVZ_tGdnZ2d@earthlink.com> (permalink)

Show all headers | View raw


Peter Duniho wrote:
> On 10/22/11 8:28 PM, Linus Flustillbe wrote:
>> [...]
>> So basically what I want to do is create a whole bunch of methods, put
>> them in one class and have them all available on demand just by
>> importing the class...no instantiations required.
>> Make sense?   This is probably silly so if it is, just ignore me..I'll
>> go away
> 
> Not silly at all.  If I understand your question correctly, you are 
> asking about "static" methods (not to be confused with "static nested 
> classes" :( ).  That is, a method that can be called using the type 
> name, rather than an instance reference.
...

Also, see the class java.lang.Math for an easily accessible example of
this in practice.

Patricia

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Question regarding methods and classes Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-23 03:28 +0000
  Re: Question regarding methods and classes Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com> - 2011-10-22 20:44 -0700
    Re: Question regarding methods and classes Patricia Shanahan <pats@acm.org> - 2011-10-23 06:14 +0100
  Re: Question regarding methods and classes markspace <-@.> - 2011-10-22 22:12 -0700
    Re: Question regarding methods and classes markspace <-@.> - 2011-10-22 22:14 -0700
      Re: Question regarding methods and classes Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-23 13:32 +0000
        Re: Question regarding methods and classes markspace <-@.> - 2011-10-23 07:43 -0700
        Re: Question regarding methods and classes Lew <lewbloch@gmail.com> - 2011-10-23 08:54 -0700
  Re: Question regarding methods and classes Roedy Green <see_website@mindprod.com.invalid> - 2011-10-23 01:37 -0700
    Re: Question regarding methods and classes Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-23 13:49 +0000
      Re: Question regarding methods and classes Roedy Green <see_website@mindprod.com.invalid> - 2011-11-02 01:23 -0700
  Re: Question regarding methods and classes Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-23 09:11 +0000

csiph-web