interface A
{
void input();
}
interface B
{
public void output();
}
class cl implements A,B
{
int a,b;
public void input()
{
a=2;
b=3;}
public void output()
{
int sum;
sum=a+b;
System.out.println(sum);
}
}
public class diya1
{
public static void main(String args[])
{
cl ob=new cl();
ob.input();
ob.output();
}
}
D:\>javac diya1.java
D:\>java diya1
5
D:\>
edited by diya
No comments:
Post a Comment