0

i did a simple interface programme where one interface extends two interface.so,no error is showing,but no output is showing..here is the code..

interface a
{
    int add(int x,int y);
}
interface b
{
int mul(int x,int y);

}

interface c extends a,b
{
int div(int x,int y);

}


class d implements c
{
public int add(int x,int y)
{
    return(x+y);
}

    public int mul(int x,int y)
    {
    return(x*y);
}

public int div(int x,int y)
{
    return(x/y);
}
}

 public class cd
{

    public static void  main(String[] args) {
    d e= new d();
    e.add(15, 5);
    e.mul(5, 7);
    e.div(49, 7);
    }

  }

Class source file is cd.java.can u plz tell me why the output is not showing?and what error i have done in the code?Thanks

2
Contributors
2
Replies
6
Views
2 Years
Discussion Span
Last Post by Sayam_1
1

There's no code there that displays anything. You have not written any code to display any output. So there is no output.

You forgot to write print statements such as

System.out.println("add: " + e.add(15,5));
0

Thank you very much james..really i forgot to write print statement....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.