0
Can anyone help me with this error?
2 Antworten
0
// I hope this code helps you
abstract class A {
public abstract int add(int a, int b);
public abstract double add(double a, double b);
public void disp(){
System.out.println("Method of class Sum");
}
}
class B extends A {
public int add(int a, int b)
{
return a+b;
}
public double add(double a, double b)
{
return a+b;
}
}
public class fourteen {
public static void main(String args[])
{
B b = new B();
b.disp();
System.out.println(b.add(5, 10));
System.out.println(b.add(2.8, 8.2));
}
}
0
SoloProg Thank you for your help 👍