Functions

Functions

  • can be inbuilt functions
  • can be user defined methods
    • with parameters
    • without parameters

 

class para
{
int f;
int g;
int h;
void setval(int a,int b, int c)
{
f=a;
g=b;
h=c;
}

int vol()
{
return(f*g*h);
}
}

class para1
{
public static void main(String s[])
{
par p1=new par();
p1.setval(10,10,10);
System.out.println(p1.vol());

}}

 

Advertisements

Constructive and genuine appreciation and/or criticism most welcome

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s