1.11M Members

internal and static

 
0
 

hi,

I have two class say class A and class B.
Now the methods in class B are used only by class A. When I checked class B, I found that few methods are static and few methods are internal.

Can you sugest me is it fine ? Or since I already have an public instance of Class B in class A so I can remove the static modifier and make it internal.

Is there any performance related issues ?

Thanks.

 
0
 

I would suggest you to make method static. The problem is that all the content of them stays in the memory until you close the application.
So use static only if really needed (or for some small methods).

About your question, it would be good to share the code with us, so we can explicitly see whats troubling you.

 
0
 

Static members and methods are instance independent. Internal members and methods are only accessible within the current assembly (similar to protected, but even derived classes outside the assembly cannot access them).

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: