it keep asking for return type. What should i put in here to get it to stop the eroor public static goForward(Drivable sedan) { sedan.accelerate(); sedan.decelerate(); } public static turn(Drivable sedan, int direction) { sedan.decelerate(); sedan.turn(direction); sedan.accelerate();
public static goForward(Drivable sedan) {} should be: public static < returnTypeGoesHere > goForward(Drivable sedan) {} If you don't want to return anything, do this: public static void goForward(Drivable sedan) {} (edited by Cindy to put spaces by the angle brackets.)
[This message has been edited by Cindy Glass (edited November 14, 2001).]
Ben Roy
Ranch Hand
Joined: Nov 01, 2000
Posts: 70
posted
0
Heh...apparently this board doesn't have a filter to watch < and > tags. There's also no edit feature. You can ignore the first part of my message where I said it should look like this: and just pay attention to he last line with the void in it.
if you want return type then it would be like this public static int(or any Data type) goForward(Drivable sedan) {} and if u don't want return type then just put void instead of return type because void doesn't return. public static void goForward(Drivable sedan) {}
[This message has been edited by Sadaf Zaidi (edited November 14, 2001).]