I'm trying to use a method from another class called Digits but referring to it in a class called FourDigits. I've tried to create an instance variable by using the following code:
public class FourDigits
private Digits TwoDigitA;
private Digits TwoDigitB;
/**
* Constructor for objects of class FourDigits
*/
public FourDigits()
{
TwoDigitA = new Digits();
TwoDigitB = new Digits();
setValues();
setIncrement();
getDisplayString();
}
The first class, Digits:
public class Digits
private int value;
private int tooHigh;
private String displayString;
public Digits(int anyNum)
{
value = 0;
tooHigh=anyNum;
displayString = "";
}
Thanks!