defualt parameter values in arguments and inheritance
Posted
by sil3nt
on Stack Overflow
See other posts from Stack Overflow
or by sil3nt
Published on 2010-05-27T04:50:37Z
Indexed on
2010/05/27
4:51 UTC
Read the original article
Hit count: 172
Hello there, Im having trouble with some Java, How do I give in default parameter values in java?. for example I have this in c++
DVD(int i, string t, int y, string d="Unknown"): Items(i,t,y),director(d){}
and in Java I tried
public Dvd(int i, String t,int y, String d="Unknown"){
super(i,t,y);
director = d;
}
which fails to build. So how do I go about giving in default values?
also In my main testing class I tried giving in 3 arguments insead of 4 but this fails also. How do I get around this problem?.
© Stack Overflow or respective owner