Выход этого кода равен 7 20.
Почему после этого печатается 7 и 20?
public class Television
{
private int channel = setChannel(7);
public Television(int channel)
{
this.channel = channel;
System.out.print(channel +"");
}
public int setChannel(int channel)
{
this.channel = channel;
System.out.print(channel + "");
return channel;
}
public static void main(String args[])
{
new Television(20);
}
}