I have 2 classes that are not the main classes, but I want class B to access the variable from class A. I am not sure how to do it.
public class A (
public int humanCakes;
//This method is called by somewhere, when it is called it adds one
public void humanCakes() {
huamnCakes ++;
}
)
public class B {
public void addUp() {
Cakes = humanCakes + 4;
}
}