Static Variable in Java
2 posters
Page 1 of 1
Static Variable in Java
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
- Posts : 1204
Earned : 4896
Credit : 4
Join date : 2013-10-15
Age : 31
Location : Bangalore
Re: Static Variable in Java
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~!
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
- Posts : 156
Earned : 312
Credit : 0
Join date : 2017-01-23
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Feb 14, 2023 1:39 pm by Designpluz
» What tag is used to insert the main and largest heading in HTML?
Tue Feb 14, 2023 1:39 pm by Designpluz
» Is any of the following software suitable for building websites?
Tue Feb 14, 2023 1:38 pm by Designpluz
» Browsers apply the tag feature until they encounter a ___ tag.
Tue Feb 14, 2023 1:38 pm by Designpluz
» Which language is helpful to create web pages?
Tue Feb 14, 2023 1:38 pm by Designpluz
» Which is the most common language used in web designing?
Tue Feb 14, 2023 1:37 pm by Designpluz
» Can comments be inserted into HTML code without being picked up by the browser?
Tue Feb 14, 2023 1:37 pm by Designpluz
» What is the point of marking an element as an ARTICLE, MAIN, HEADER, or ASIDE?
Tue Feb 14, 2023 1:36 pm by Designpluz
» Are there any ways to reduce the loading time for a page?
Tue Feb 14, 2023 1:36 pm by Designpluz