Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
What are the different scopes for Java variables?
What are the different scopes for Java variables?
✍: Guest
The scope of a Java variable is determined by the context in which the variable is declared. Thus a java variable can have one of the three scopes at any given point in time.
1. Instance : - These are typical object level variables, they are initialized to default values at the time of creation of object, and remain accessible as long as the object accessible.
2. Local : - These are the variables that are defined within a method. They remain accessbile only during the course of method excecution. When the method finishes execution, these variables fall out of scope.
3. Static: - These are the class level variables. They are initialized when the class is loaded in JVM for the first time and remain there as long as the class remains loaded. They are not tied to any particular object instance.
2013-06-28, 2167👍, 0💬
Popular Posts:
Can you explain Forms authentication in detail ? In old ASP if you where said to create a login page...
Can event’s have access modifiers ? Event’s are always public as they are meant to serve every one r...
How do we access attributes using “XmlReader”? Below snippets shows the way to access attributes. Fi...
Can you explain in brief how the ASP.NET authentication process works? ASP.NET does not run by itsel...
How to reduce the final size of an executable file? Size of the final execuatable can be reduced usi...