English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Is there anyone that can help me with the concepts of Java. I would like some one to explain the concepts of constructors and how they are used to preform functions in Java. I understand that this isnt a 5 minute answer, so if anyone is interested, please email me at abhijeetsutrave@yahoo.com

2006-10-28 02:44:11 · 5 answers · asked by abhi 2 in Computers & Internet Programming & Design

5 answers

Try the serious links and then relax with this one

2006-10-28 02:49:04 · answer #1 · answered by jan 7 · 2 1

I ll explain u wat is a constructor and its purpose. But if u have already learnt c++ thoroughly u wont have doubt. becoz this is the basic.

Constructor:-

i) Whenever an object is created first the constructor will be called.
ii) Constructor will have the same name as the class name.
iii) Constructor is similar to functions but it does not have any return type.(becoz it implicitly returns object of its own type)
iv) Constructors are used to initialize the object with the defualt value at the time of object creation itself.
v) Like function overloading, the constructor can also be overloaded.
vi)System(ur JVM environment) will automatically provide empty arg constructor which is called as null arg constructor or default constructor if u r not specifying it.
vii) It is always recommended that every class must have a defualt constructor.
viii)When u r creating the object or instance, depending on the number of arguments passed, the corresponding constructor will be invoked.
ix) If u dont want to create an object then make the constructor as private.
I think this will help u. Study ur prescribed book. Bcoz this is very important in oops. Still the concept of inheritance deals with constructors also.
All the best.

2006-10-28 13:04:55 · answer #2 · answered by Sudha P 2 · 0 0

I think you should read some books on Java and object oriented programming.
Prefarbley you may read Complete referance on Jvava by Herbert Schildt.

2006-10-28 12:39:20 · answer #3 · answered by Tanaeem 4 · 0 0

Do u have Schildt J2SE5? Then mail me. I shall tell u topics and chapters to read.

2006-10-28 11:40:39 · answer #4 · answered by binaryFusion 5 · 0 0

http://java.sun.com/docs/books/tutorial/
http://www.peterindia.net/ITTutorials.html#Java%20Tutorials

2006-10-28 09:46:01 · answer #5 · answered by Anonymous · 1 0

fedest.com, questions and answers