0
Calculate
package code; class Mycalculate { int z; public void add(int x,int y){ z=x+y; System.out.println("sum:"+z); } public void sub(int x,int y){ z=x-y; System.out.println("difer:"+z); } } class calcul extends Mycalculate{ public void mul(int x,int y){ z=x*y; System.out.println("product:"+z); } public static void main(String args[]){ int a=10; int b=20; calcul cal=new calcul(); cal.add(a,b); cal.sub(a,b); cal.mul(a,b); } }
2 Respostas
+ 5
What's your question?
It's working properly, use this thread only when you have any question.
https://www.sololearn.com/discuss/1316935/?ref=app
+ 2
Abdeta Reshid, Use Code section for Uploading codes and get feedbacks about your work. here you can ask doubt/question related to programming