i have a question, im extending a class P which holds xpos and ypos, as i understand when you extend a class you automagicaly have access to its methods and variables, but for some reason, i can only set the variables through a constructor, how come i just cant say xpos = 1; in the extended class like this ?
//bre
class P { float xpos=0; float ypos=0;
}
class Test extends P {
// why cant i do it this way ? xpos = 1;
// this works with constructor // Test(float x,float y){ // xpos=x; // ypos=y;