Here is the problem
I have a one abstract class named MovingObject.java and I want to call some of methods in abstract class. I have written one class named MyMovingObject.java which extends from abstract class and I have written constructors to override super-class constructors. I guess Now the subclass will contain all the superclass methods with defined methods init. Then I have created one more class named Simulator.java and this class extends from MyMovingObject.java and I have created object to MyMovingObject class but when I am calling methods from abstract class, I am getting null as a returned values for all methods,I want to call routePlan() method in MovingObject.java these are the programs
this is the I have written one class which extends from abstract class
Now I have written one more class which extends MyMovingObject.java and this is the code I have written
thanks for your reply I tried with that option also but giving errors in that setRoutePlan() method we need to pass something ,Here I tried with pasing same arguments and got the error, and I am confused what else I need to pass setRoutePlan() method when I am calling
by passing value 1 while creating object to Route class is the size of the ArrayList right? I ran the code and got zero as a output.But it will return list of objects(that is actually RoutePlan-RoutePLan will have list of motionless Objects) ,but its not returning expected value and what might be the solution to get expected output..
Pretend you're the computer. Trace through the execution line by line.
Try posting what you think is happening; it should be an ordered list of steps from where you start executing until the end. Post the *exact* code that you believe is being executed by the steps you list. When you run the program, see if the code you believe is being executed is actually executed. If there's a discrepancy between what is happening and you *think* should be happening, try to figure out why.
Remember: we don't have your computer in front of us. It's difficult to figure out what *is* happening vs. what *should* be happening and compare both to your expectations. If you have to, post the entire code again, and maybe somebody will copy it in to their IDE and see if we can point you in the right direction.
subject: Called abstract class methods from another class returns null value