May 28, 2007

JAVA program to demonstrate parameterized function

class demo
{
void add(int a,int b) // method definition
{
int c=a+b;
System.out.println(c);
}
};


class adddemo
{
public static void main(String[] args)
{
demo d1;
d1 =new demo();
d1.add(10,20); // calling of a function
}
}

No comments:

Post a Comment