answersLogoWhite

0

C# function or a method can be called as described below: -

Public class myClass
{

int num;

public myClass(int n)
{
num=n;
}

public int returnSquare()
{
return num*num;
}

}

Public class startUpClass
{

Public static void Main(StringArgs ar)
{
myClass obj=new myClass(12);
int result=obj.returnSquare();
}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How a java function can be called in c sharp?

Check this out http://www.codeproject.com/KB/cross-platform/javacsharp.aspx


What the difference from C sharp and C note?

That is commonly called a half step.


Who is calling main function in c?

in c main function initailly called by operating system.


What are the notes to?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the Flute btw idk what instrument its on


What are the notes to fireflies?

A sharp G G E sharp G E sharp A sharp A sharp C C A sharp C E sharp G A G E sharp A sharp A sharp A sharp G E sharp C this is not on the flute btw idk what instrument its on


How do you play Simpson theme on keyboard?

here it is C,E,F SHARP,A,G,E,C,A,F SHARP,F SHARP,F SHARP,G,A SHARP,C,C,C,C


What key signature has G sharp B sharp and C sharp?

C# Major


What is it called when the same note can be called by two different names?

It's called enharmonic spelling. An example is C-sharp and D-flat.


What are the notes for the c sharp harmonic scale?

C sharp, D sharp, E natural, F sharp, G sharp, A natural, B sharp & C sharp We call the note C "B sharp" to avoid using the same letter name twice. If we used the note name "C" we would have 2 C-notes and no B-notes in the scale!


What is the definition for call by value in c language?

A function is called within a function either called by value or called by reference.When a function is called by passing the values of one or more variables,then the value is copied to a new var of the function's own var of its scope.Ex:void main(){...........c=fun(a,b);...}fun(int c,int d){ int t;t=c+d;return(t);}


How do you make a call to a function in C?

Example:puts ("I've just called function 'puts'");


What is the tonic note for C sharp minor?

The tonic is C sharp.