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


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

Re: Question regarding methods and classes

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.lightlink.com!news.iecc.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.posted.palinacquisition!news.posted.palinacquisition.POSTED!not-for-mail
NNTP-Posting-Date Sat, 22 Oct 2011 22:44:14 -0500
Date Sat, 22 Oct 2011 20:44:12 -0700
From Peter Duniho <NpOeStPeAdM@NnOwSlPiAnMk.com>
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Question regarding methods and classes
References <4ea389df$0$13444$9a566e8b@news.aliant.net>
In-Reply-To <4ea389df$0$13444$9a566e8b@news.aliant.net>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <F_GdndVSBOITED7TnZ2dnUVZ_jidnZ2d@posted.palinacquisition> (permalink)
Lines 23
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 50.46.118.188
X-Trace sv3-6BMxT5JiaeARff4l9QpvjsoqEPf++HYDMuFZUCiRIBEM8nTvQhPZt6R/OZvNrLLe8VS0ePTYq6YiI1q!4182dK38hHOBeZiOsg3yMNcVjoTwqlhyUF3J8prkBcIdvmmAn05BGfZ6JDzo1HxM77gn21alCwGr!pBad6KDnrtLw+oRYmAJsEEKjALVKNkGV9G456LBV8sY=
X-Complaints-To abuse@iinet.com
X-DMCA-Complaints-To abuse@iinet.com
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2264
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9101

Show key headers only | View raw


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.

They can be quite useful, when you need to implement some functionality 
that does not depend on some specific instance data.

You can also have static data members; those members are, like the 
static methods, referenced using the type name rather than an instance 
reference.

See http://download.oracle.com/javase/tutorial/java/javaOO/classvars.html

Pete

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


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