我有一个主要的类,用户输入数据后,我想去另一个类。我不知道如何去下一个类,并继承java代码中的值x和y。类继承java
public class main {
int x=25;
int y =25;
//Go to next class second
}
public class second {
//inherit values of x and y
//manipulate values
//Go to next class third
}
public class third {
//inherit values of x and y from second class
//manipulate values
}
请阅读[this](http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html)。 – mre 2012-02-02 15:41:20