Static Method, Static Block & Static Variable | Java Static Keyword | Java Tutorial 2023 | PT

Publié le: 11 février 2022
sur la chaîne: Parnika Tutorials
296
10

"Static Method, Static Block & Static Variable |Java Static Keyword | Java Tutorial For Beginners 2023 |Parnika Tutorials

#staticmethod #staticblock #staticvariable #statickeyword #javakeyword #javaclass #featuresjava #java #javafullcourse #javatutorials #javaforbeginners #javalanguage #learnjava #javacompletecourse #javaprogramming #javatutorialforbeginners #parnikatutorials #javacourse #java2023 #javacourse2023

02:25 - instance variables
03:44 - main class
13:21 - static method
14:16 - acess the static method using the object
16:25 - the static block
20:15 - multiple static blocks
21:29 - static variable
21:49 - display method
21:54 - instance method
29:40 - instance method to a static method
32:01 - static block"

Social media Links:
Instagram:   / parnikatutorials  
Website:
Email id: parnikatutorials@gmail.com
To get the regular updates:
Telegram link: https://t.me/Parnikatutorials
Facebook: https://m.facebook.com/profile.php?id...
Linkedin:   / parnika-tutorials-a8a9831b2  
Pinterest:   / parnikatutorials0892  

Playlists:
Virtual Coffee with Jagadeesh:    • VIRTUAL COFFEE WITH JAGADEESH  
Digital Logic:    • ABOUT PARNIKA TUTORIALS  
Computer Organization and Architecture:    • ABOUT PARNIKA TUTORIALS  
C Programming:    • L 1: WHAT IS AN ALGORITHM AND CHARACTERIST...  
Data Structures:    • L 1: Uncover the Benefits of Linked List: ...  
Theory of Computation:    • ABOUT PARNIKA TUTORIALS  
Compiler Design:    • ABOUT PARNIKA TUTORIALS  
Operating Systems:    • PROCESS STATE DIAGRAM | LONG TERM, SHORT T...  
Databases:    • ABOUT PARNIKA TUTORIALS  
Computer Networks:    • ABOUT PARNIKA TUTORIALS  
For GATE PYQs and much more explore:    / parnikatutorials  

Static variable in Java is variable which belongs to the class and initialized only once at the start of the execution. It is a variable which belongs to the class and not to object(instance ). Static variables are initialized only once, at the start of the execution. These variables will be initialized first, before the initialization of any instance variables.

A single copy to be shared by all instances of the class
A static variable can be accessed directly by the class name and doesn’t need any object

Static method in Java is a method which belongs to the class and not to the object. A static method can access only static data. It is a method which belongs to the class and not to the object(instance). A static method can access only static data. It cannot access non-static data (instance variables).

A static method can call only other static methods and can not call a non-static method from it.
A static method can be accessed directly by the class name and doesn’t need any object
A static method cannot refer to “this” or “super” keywords in anyway
The static block is a block of statement inside a Java class that will be executed when a class is first loaded into the JVM. A static block helps to initialize the static data members, just like constructors help to initialize instance members.

class Test{
static {
//Code goes here
}
}


Sur cette page du site, vous pouvez voir la vidéo en ligne Static Method, Static Block & Static Variable | Java Static Keyword | Java Tutorial 2023 | PT durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Parnika Tutorials 11 février 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 296 fois et il a aimé 10 téléspectateurs. Bon visionnage!