Affiliates
Latest topics
» Heading tags
Yesterday at 9:46 pm by sameergupta12

» Organic result
Yesterday at 9:39 pm by sameergupta12

» Do-Follow link
Sat Dec 09, 2017 10:06 pm by komaljain0012

» important to the human body?
Sat Dec 09, 2017 4:18 pm by nishajain1421

» difference between .in and .com...?
Thu Dec 07, 2017 3:38 pm by vishakhajain

» percentage of water covered ,on earth..?
Thu Dec 07, 2017 2:43 pm by ShrutiDesai

» Doorway pages
Wed Dec 06, 2017 9:20 pm by nidhijain1221

» name of the first mission to space...?
Wed Dec 06, 2017 8:28 pm by anshitajain1212

» opinion about the "Ayodhya case"..?
Wed Dec 06, 2017 3:04 pm by ranisharma1531


Static Variable in Java

View previous topic View next topic Go down

Static Variable in Java

Post by bangalorewebguru on Fri Jul 31, 2015 2:46 pm

Class variables also known as static variables are declared with the static keyword in a class, but outside a method, constructor or a block.

bangalorewebguru
platinum
platinum

Posts : 1115
Earned : 4481
Credit : 4
Join date : 2013-10-15
Age : 30
Location : Bangalore

View user profile http://www.bangalorewebguru.co.in/

Back to top Go down

Re: Static Variable in Java

Post by tyagi on Fri Mar 31, 2017 6:54 pm

1.It is a variable which belongs to the class and not to object(instance)
2.Static variables are initialized only once , at the start of the execution . ...
3.A single copy to be shared by all instances of the class.
4.A static variable can be accessed directly by the class name and doesn't need any object.

Thank you~!

tyagi
platinum
platinum

Posts : 156
Earned : 312
Credit : 0
Join date : 2017-01-23

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum