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: School work Question 1

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default School work Question 1

    Hi Java Professionals,
    I need to do the following question and I don't know how to do, please teach me, thanks a lot in advance.

    A constructor can invoke the constructor of the the direct superclass using the superclass constructor invocation(i.e. super(argumentList).

    a)true
    b)false


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,104
    My Mood
    Mellow
    Thanks
    244
    Thanked 755 Times in 741 Posts

    Default Re: School work Question 1

    We won't do your work for you. What do you think the answer is? Provide an example to demonstrate why it is or isn't the case.

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: School work Question 1

    The answer should be true. Please refer to the following example.

    public class Example
    {
    String id;

    public Example(String i)
    {
    this.id = i;
    }
    }
    public class Example2 extends Example
    {
    String name;
    public Example2(String id,String n)
    {
    super(id);
    this.name =n;
    }
    }

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,104
    My Mood
    Mellow
    Thanks
    244
    Thanked 755 Times in 741 Posts

    Default Re: School work Question 1

    So you figured it out then. Good job.

    In future, please post your code correctly.

Similar Threads

  1. [SOLVED] My fleet of squares doesnt work (simple high school work)
    By macko939 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: February 20th, 2014, 02:56 PM
  2. School Lab Work
    By JWingate in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 4th, 2013, 06:35 AM
  3. Replies: 1
    Last Post: September 9th, 2013, 12:26 PM
  4. Simple java beginners question (for school)
    By Jeesie in forum Java Theory & Questions
    Replies: 5
    Last Post: November 7th, 2012, 06:32 PM
  5. Beauty School student taking JAVA? doesn't work out so well, NEED HELP!
    By tmihans in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 20th, 2011, 08:58 AM