Static keyword plays a vital role in Java programming. Understanding of the static keyword will help us a lot while coding.
Static can be used with Class, method, variables and even with a block of code.
Points to remember about static keyword:
1)can be used with class, variable, method and block.
2)belong to the class instead of a specific instance,
this means if you make a member static, you can access it without an object.
NOTE: We can call the static method from the non-static method but not otherwise
Static block:
--------------------
1)initializing the static variables.
2)gets executed when the class is loaded in memory.
3)can have multiple Static blocks, execution in the written order
Static Variables
-------------------------
1)common to all the instances (or objects) of the class because
it is a class level variable.
2)only a single copy of the static variable is created and
shared among all the instances of the class.
Static Class:
-----------------------
A class can be made static only if it is a nested class.
We don't need this. Because we won't use the nested class in most of the real-time programming with respect to test automation.
Community:
-------------------
Best way to reach me (replies will be faster): YouTube comment section
If you want to post your code snippet/screenshot, please ask in my forum:
http://bit.ly/2C2ZISR
Also, you can follow me on Facebook and Instagram.
Facebook: https://bit.ly/2TqPlis
Instagram: https://bit.ly/2Ez36rH
#Java #LearnAutomationOnline #StaticKeyword
En esta página del sitio puede ver el video en línea Java Crash course | 07 | Java STATIC Keyword Explained | Tamil | Java for Automation de Duración hora minuto segunda en buena calidad , que subió el usuario Learn Automation Online 03 marzo 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 41,018 veces y le gustó 634 a los espectadores. Disfruta viendo!