Good, can someone tell me what this this does?
public Tempo (){
this(0,0,0);
}
public Tempo (int h){
this(h,0,0);
}
public Tempo ( int h,int m){
this (h,m,0);
}
public Tempo (int h,int m , int s){
SetTime(h,m,s);
}
Good, can someone tell me what this this does?
public Tempo (){
this(0,0,0);
}
public Tempo (int h){
this(h,0,0);
}
public Tempo ( int h,int m){
this (h,m,0);
}
public Tempo (int h,int m , int s){
SetTime(h,m,s);
}
The% construct of% inside the constructor serves to call another constructor.
In other words, this
will call the constructor
public Tempo (int h,int m , int s){
SetTime(h,m,s);
}
It can not be used in a conventional method and must be the first instruction inside the constructor, ie if you want to use it. It's just a way to keep the object initialization logic in just one of the constructors.