Hi, I tried to override toString but got the message: unreachable code. Can anyone help m eon this? Thanks
public
String toString(){//override toString()
return "Passengers:" + getP();//P,T,M are get method. I changed it to variable--the return variable in the getter method, doesnot help
return "Tank Capacity:" + getT();///wrong message at this line
return "MPG:" + getM();
}
public static void main(String[] args){
Vehicle details= new Vehicle();
System.out.println(details);
}