1,105,625 Community Members

internal and static

Member Avatar
surajrai
Newbie Poster
16 posts since May 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
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.

Member Avatar
Mitja Bonca
Posting Maven
2,561 posts since May 2009
Reputation Points: 557 [?]
Q&As Helped to Solve: 489 [?]
Skill Endorsements: 21 [?]
 
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.

Member Avatar
skatamatic
Posting Shark
980 posts since Nov 2007
Reputation Points: 371 [?]
Q&As Helped to Solve: 133 [?]
Skill Endorsements: 5 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: