Just want to confirm if it is possible to set in this case (Example 1) class Two's pumpId variable by sending it as a parameter to class One's setPumpId method without using the usual return method assignment like :
pumpId = o.getPumpNum()
I think in C++ we can do that, but just ain't too sure with JAVA and I'm having problem returning more than one value from a method with just a return statement in the end which I think is impossible. :-|
Example 1:
public Class One {
private int pumpNum = 3;
public void setPumpId(int pumpId)
{
pumpId = pumpNum;
}
}
public Class Two {
private int pumpId = 0;
private One o = new One();
o.setPumpId(pumpId);
}
Thanks in advance for any replies. Really need this for my petrol station simulation project. :mrgreen: