I'm sure this is incredibly common with as OOP centered as Java is. In java is there a way to make a base type variable that accepts all inherited subtypes? Like ...
I have a base class, let's call it DispenseResult that stores the result of a machine operation. I am designing for a family of machines. DispenseResult will contain member ...
I have been trying to figure this out and I dont seem to understand why this code outputs 8. I tried compiling it and it does give 8 but I dont know have a reason to back the answer. Can someone kindly tell me why variable "value" takes the number from the base class and not from the super class class ...