initialize category fields constructor during declaration?


i've programming c# java recently i am extraordinary where best place initialize category fields.



should i during declaration?:



public category dice
{
private int topface = 1;
private futile myrand = new random();

open vacant roll()
{
// ......
}
}


or constructor?:



public category dice
{
private int topface;
private futile myrand;

open dice()
{
topface = 1;
myrand = new random();
}

open vacant roll()
{
// .....
}
}


i'm unequivocally extraordinary veterans cruise best practice. i wish unchanging hang approach.



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?