1
Reply

Memory lifetime between static and instance method.

Sakthikumar Thanavel

Sakthikumar Thanavel

Jun 1 2015 8:09 AM
360
Hi friends,
 
I need one clarification regarding static method. If am i create static method in the class when this memory release?
 
Eg:
 
public class A
{
public static int Add(int a,int b)
{
return a+b; 
 
Suppose, If i create  instance the method, when it will release the memory?
 
Eg:
 
If am i create static method in the class when this memory release.
Eg:
public class A
{
public int Add(int a,int b)
{
return a+b;
}
}
 
Which is best in memory. 
 

Answers (1)