package p2;
import java.util.*;
public class midterm2task2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Banana b = new Banana(3, "Yellow");
}
}
abstract class Fruit{
double sweetness;
Fruit(double sweetness){
this.sweetness = sweetness;
}
abstract void print();
}
abstract class Banana extends Fruit{
String color;
Banana(double sweetness, String color){
super(sweetness);
this.color = color;
}
}
abstract class Mellons extends Fruit{
int weight;
Mellons(double sweetness, int weight){
super(sweetness);
this.weight = weight;
}
}
abstract class Watermellons extends Fruit{
int weight1;
Watermellons(double sweetness){
super(sweetness);
this.weight1 = weight1;
}
public void returnWeight(){System.out.println("Weight is: " + weight1); }
}