Sakthikumar Thanavel

Sakthikumar Thanavel

  • NA
  • 1.2k
  • 98.9k

Memory lifetime between static and instance method.

Jun 1 2015 8:09 AM
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)