What will be the output of the following program?
public class MotorsAndPrices {
public static void main(String[] args) {
Motor m = new Motor();
WaterMotor w = new WaterMotor();
m.manufacturer = "Suguna";
m.price = 15_234_0;
w.manufacturer = "VGuard ";
w.price = 1_52_340;
p(m.manufacturer, m.price);
p(w.manufacturer, w.price);
m = w;
p(m.manufacturer, m.price);
m.manufacturer = "Falcon";
p(w.manufacturer, w.price);
}
private static void p(String manufacturer, double price) {
System.out.print(manufacturer + "#" + price + "#");
}
}
class Motor {
String manufacturer;
double price;
}
class WaterMotor extends Motor {
String manufacturer;
double price;
}