Buy Questpond's video subscriptions on
huge discount
.
Online: 2487
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
Interview Questions
>
Loading ...
static variable , public static, and private static [Resolved]
Posted by
Mcadeepuraj
under
Interview Questions
on 3/7/2011 |
Points: 10
| Views : 3707 | Status :
[Member]
| Replies : 2
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
what is static variable, what is private static and public static.
Deepak Kumar
[Resolved]
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Gsolvers
on: 3/7/2011
[Member]
Starter
|
Points: 50
0
static variables are those variables whose values are shared among various instance of an class. For e.g. if you have a static variable "x" in class "A" and you create two instances of A i.e. a1 and a2. In that case a1 and a2 will share the common variable. This means if a2 changes the value of x than this will be changed for a1 as well.
Class A
{
static int x;
}
A a1=new A();
A a2=new A();
a1.x=10;
then a2.x will also become 10.
Hope the above helps. Also Private and public are having the same global meaning. This means private static are accessible within the class but public are accessed outside the class as well.
Best Regards,
VG
www.TeacherJi.com
Mcadeepuraj
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Posted by:
Karthikanbarasan
on: 3/7/2011
[Member]
[Moderator]
[Microsoft_MVP]
[MVP]
Silver
|
Points: 25
0
Check these links
http://www.eggheadcafe.com/articles/20020206.asp
http://msdn.microsoft.com/en-us/library/aa691162(v=vs.71).aspx
Thanks
Karthik
www.f5Debug.net
Mcadeepuraj
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...