Constructor with less arguments from a constructor

Posted by mike_hornbeck on Stack Overflow See other posts from Stack Overflow or by mike_hornbeck
Published on 2010-03-28T22:50:10Z Indexed on 2010/03/28 22:53 UTC
Read the original article Hit count: 605

Filed under:
|

I have Constructor Tree(int a, int b, int c) and second Constructor Tree(int a, int b, int c, String s). How to load second constructor from first just to save writing all the logics ? I thought about something like this but it gives me 'null' object.

public Tree(int a, int b, int c){
    Tree t1 = new Tree(a, b, c, "randomString");
}

© Stack Overflow or respective owner

Related posts about java

Related posts about constructor