Re: Initiating a class
- From: Roedy Green <see_website@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Jun 2007 11:48:30 GMT
On Thu, 28 Jun 2007 08:29:33 -0700, christopher_board@xxxxxxxxxxx
wrote, quoted or indirectly quoted someone who said :
I am trying to write a program that has a separate class file to the
rest of the functions within the program. How would I go about making
a section of the program run what it is inside the class.
Any help in this matter would be appreciated
If you want to run a static method x inside class X you would write
X.x()
If you want to run an instance method inside class X, you first must
instantiate an object of type X with the constructor.
X myobject = new X();
Then you can invoke the method on it:
myobject.x();
see http://mindprod.com/jgloss/constructor.html
http://mindprod.com/jgloss/static.html
http://mindprod.com/jgloss/instance.html
http://mindprod.com/jgloss/method.html
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.
- References:
- Initiating a class
- From: christopher_board
- Initiating a class
- Prev by Date: Re: How to create a setup or exe file from a class file.
- Next by Date: test imap and pop3
- Previous by thread: Re: Initiating a class
- Next by thread: Need help with running examples in JAXB in the JWSDP
- Index(es):
Relevant Pages
|