Can anyone help me with this error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
15th Oct 2022, 6:46 AM
SUKHBEER SINGH
SUKHBEER SINGH - avatar
2 Answers
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)); } }
15th Oct 2022, 7:39 AM
SoloProg
SoloProg - avatar
0
SoloProg Thank you for your help 👍
15th Oct 2022, 7:42 AM
SUKHBEER SINGH
SUKHBEER SINGH - avatar