我是初学者,所以请非常具体。无论如何,我在这里有三个代码类,我想从 cb 然后 ba 访问数据
class GoobyPls {
{
private int CHealth = 20;
private int MHealth = 20;
private int CAgility = 10;
private int MAgility = 10;
private int CDefence = 5;
private int MDefence = 5;
}
}
class Stats {
public static void foo() {
string Health = CHealth + "/" + MHealth ;
string Agility = CAgility + "/" + MAgility;
string Defence = CDefence + "/" + MDefence;
}
}
class ViewStats {
public static void foo() {
System.out.println("Health");
System.out.println(Health);
System.out.println(" ");
System.out.println("Agility");
System.out.println(Agility);
System.out.println(" ");
System.out.println("Defence");
System.out.println(Defence);
System.out.println(" ");
}
}
如此,GoobyPls
如此,如此,如此a
Stats
b
ViewStats
c
我也不能把它全部放在一个类中,因为最终会有一个修饰类来编辑CHealth
,MHealth
等等