Using the return statement to display a string
I was assigned this program for homework, and everything works fine, except where I try to use return to display the words " is stopping." I have no idea what I'm doing wrong. Here's the code, and some background on the purpose of the assignment below:
public class Elevators
public static void main (String args)
ElevatorController eastelevator = new ElevatorController();
ElevatorController westelevator = new ElevatorController();
ElevatorController northelevator = new ElevatorController();
public static String stop_elevator(ElevatorController elevator_name)
String stopper = " is stopping!";
public void move_up()
System.out.println(this + " moving up!");
public void move_down()
System.out.println(this + " moving down!");
private void report_elevator_name()
I'm incredibly new to both programming and java, so I'm sure this question seems ridiculous, but I'm stuck!
My homework assignment was to make a program which displayed this text:
ElevatorController@72e3b895 moving up!
ElevatorController@446b7920 moving down!
ElevatorController@72e3b895 is stopping!
ElevatorController@6bdd46f7 moving up!
ElevatorController@446b7920 is stopping!
ElevatorController@6bdd46f7 is stopping!
The professor provided the method signatures he wanted us to use, and when I finished the code everything displayed properly except the parts that say " is stopping!" I've been stuck trying to figure out why forever.
Thanks so much for your help!