Your Qna     New Questions     About Qna
EQNA is a growing interactive people-knowledge network with more than 120,000 questions and 450,000 answers from over 55,000 members worldwide. With all friendly functions, EQNA will be a fun place to join, share and discover knowledge, an open net space allowing you to connect with other people having specialized knowledge or ones with same interests to yours. EQNA login features secured logins using Twitter and Facebook enable you to place questions without sharing your personal information to us. Lets get out and join our community today!
Ask a Question

programing with Java: What are constructors and instanciations and how to use them?

I'm new to java and don't understand a few things. I don't want the code (that would be cheating :)), just an explanation, examples are fine too

Constructors are declarations of a class that can take parameters (or not) like methods. They have no return type... they are simply ways of instantiating a class. Interfaces and abstract classes cannot be instantiated.

For example, a constructor would be made like this.
public Foo (String fooBar)
//code for constructor

Instantiations are creating instances of class variables.
For example:

String foo;

Unless you initialize this String to a value by using a line like

foo = new String("foo");

then the instantiation will be null.

Does that help? :-)

Text ColorBackground Color
Ordered ListBulleted List
Horizontal Rule
Design ModeDesign
Html ModeHtml

Top Question And Answer

  • What's a good college to go to when you're planning on majoring in computer programing?
  • Who want to chat with me? I'm a Chinese student.I intrested in programing.(I'm learning c#)
  • what's the items i need 2 download on my laptop through my aircard 2 received tv programing wireless
  • Who do you think will win the 2007 formula one drivers and constructors titles?
  • I want to buy a bag,what is the
  • How is
  • Www.mokahandbags .com
  • Facebook new account opening form
  • Hom account
  • Hom bhr0165301533
  • Hom account
  • Hom bhr0165301533
  • how do I get mms message fro.
  • Find out how many cars of my model are registered
  • What would happen if a letter opens in the mail
  • Facebook new account open
  • Facebook New Account Creation
  • Facebook new account creation
  • locating a business that closed