Hi to everybody. I am a java beginner and i worried about constructors. What is the main role of constructors in Java Language? 
Constructors in Java, help
| pollux1er wrote: |
| Hi to everybody. I am a java beginner and i worried about constructors. What is the main role of constructors in Java Language? |
Constructors handle initialization. They set initial variables and you need to call one before using an object (or it will throw null pointer exceptions.)
Constructors are a pretty basic part of OOP and I recommend you read some java tutorials on this because it is something you should know. Maybe someone here can offer a more detailed explanation though.
| snowboardalliance wrote: | ||
Constructors handle initialization. They set initial variables and you need to call one before using an object (or it will throw null pointer exceptions.) Constructors are a pretty basic part of OOP and I recommend you read some java tutorials on this because it is something you should know. Maybe someone here can offer a more detailed explanation though. |
Thanks first for the explanation you gave. It is helpful.
Are you worried specifically about constructors because you know another language that doesn't have them? Are you familiar w/ OOP?
| jabapyth wrote: |
| Are you worried specifically about constructors because you know another language that doesn't have them? Are you familiar w/ OOP? |
Don't confuse the kid.
