Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Constructors: Can Anyone Explain Them to Me?

  1. #1
    Junior Member
    Join Date
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Constructors: Can Anyone Explain Them to Me?

    I just started getting into java programming, so I'm a really new beginner. I've been mainly following thenewboston's series on youtube from 2009 . I just came across this episode on multiple constructors: https://www.youtube.com/watch?v=LS7BzkBzn3Y&list=PLFE2CE09D83EE3E28 and I have no clue what he is talking about for the whole episode.
    So, getting to the point, can anyone please explain what constructors are, how they work, when they are used, and what they are used for, and anything else that would contribute to bettering my understanding of the topic. Or just like an easy to understand example or explaining what the code that the guy in the video wrote means.

    Thanks,
    Evan


  2. #2
    Junior Member vasanthjayaraman's Avatar
    Join Date
    Jul 2013
    Location
    Chennai
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Constructors: Can Anyone Explain Them to Me?

    * Constructor is a special type of method
    * It is used to Initialize the State of the Object
    * Constructor Does not have any return type

    Rules:
    >> Constructor name must Same as it's Class name
    >> Constructor must have no return type..

    Types:
    >>> Default Constructor
    >>> Parameterized Consructor.

    I hope It is HelpFull............

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,104
    My Mood
    Mellow
    Thanks
    186
    Thanked 656 Times in 643 Posts

    Default Re: Constructors: Can Anyone Explain Them to Me?

    Write code that uses constructors, and you'll understand them. Reading about them or watching videos about them will not help (much).

  4. #4
    Junior Member
    Join Date
    Jul 2013
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Constructors: Can Anyone Explain Them to Me?

    Constructors are mainly used to create new objects, and they are one of the most important things in OOP(Object oriented programming). So make sure you read about them a lot.

Similar Threads

  1. explanatio on Constructors and others
    By OlayinkaAgboola in forum Member Introductions
    Replies: 0
    Last Post: November 1st, 2012, 08:48 AM
  2. Constructors
    By av8 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: July 19th, 2011, 06:40 PM
  3. constructors in servlets
    By the light in forum Java Servlet
    Replies: 3
    Last Post: June 27th, 2011, 04:13 AM
  4. [SOLVED] Overloading constructors(Multiple Constructors)
    By chronoz13 in forum Java Theory & Questions
    Replies: 2
    Last Post: May 11th, 2011, 12:55 PM
  5. Replies: 1
    Last Post: December 13th, 2010, 04:13 AM