Can you help me to modify this code? I want my code to display the addition method and subtraction in two classes also.
interface TypeOfNumber
{
int a=10;
int b=6;
void addition(int a,int b);
void subtraction(int a,int b);
}
class Integers implements TypeOfNumber {
public void addition()
{
System.out.println(“The sum is :”+(a+b));
}
public void subtraction()
{
System.out.println(“The difference is :”+(a+b));
}
class Floats implements TypeOfNumber {
public void addition()
{
System.out.println("The sum of the two float nums are: "+(a+b));
}
public void subtraction()
{
System.out.println("The difference of the two float nums are: "+(a+b));
}
class TestTheNumber {
public static void main(String args[]) {
TypeOfNumber obj=new Integers(10,6);
obj.addition(TypeOfNumber.addition)