class demo
{
void add() // method definition
{
int a,b,c;
a=10;
b=20;
c=a+b;
System.out.println(c);
}
};
class adddemo
{
public static void main(String[] args)
{
demo d1;
d1 =new demo();
d1.add(); // calling of a function
}
}
No comments:
Post a Comment