Well, as far as Java is concerned, you're only ever supplying the program with 0
.
Take this line:
tempArray[j] = input[j].output();
output
will be 0.0, as its initial value upon construction will be 0.0
. The reason for this: output
uses the field number
to return its value, and since there's nowhere in your code that you explicitly assign number
to a value, it will always be returning 0.0
.
To fix it, depending on your logic or desired operation, you should initialize it either on InputNode
's construction...
public InputNode(double value) {
number = value;
}
...or on Node
's construction - forcing you to use the constructor described above:
public Node(double number) {
this.number = number;
}
public InputNode(double number) {
super(number);
}