there is some typos and missing parameters
correct : | your code ..explanation | class |
---|
class Santro extends Car { | Sai ..doesn't exist | Santro |
void steering(int direction){ | sterring ..typo at 'terr' | Santro |
Maurthi M =new Maurthi(); | Maruthi M ..typo at Mar | Demo2 |
M.fillTank(); | M.openTank(); ..'open' doesn't exist | Demo2 |
S.fillTank(); | S.openTank(); ..'open' doesn't exist | Demo2 |
M.steering(1); | M.sterring() ..typo at 'terr'|no parameter | Demo2 |
S.steering(2) | S.sterring() ..typo at 'terr'|no parameter | Demo2 |
M.brakes(400); | M.brakes(); ..no parameter | Demo2 |
S.brakes(600); | S.brakes(); ..no parameter | Demo2 |
// corrected Demo2
public class Demo2 {
public static void main(String args[]) {
Maurthi M =new Maurthi();
M.fillTank();
M.steering(1);
M.brakes(400);
Santro S =new Santro();
S.fillTank();
S.steering(2);
S.brakes(600);
}
}
then Output is:
regno2000
Tank is full
LEFT
DRUM BRAKES
regno5000
Tank is full
STRAGHIT
DISC BRAKES