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