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

preview_player
Показать описание
"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:
To get the regular updates:

Playlists:

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
}
}
Рекомендации по теме
Комментарии
Автор

Good evening sir.
sir ippudu void display()
kinda id, name okasari print chesaru
static variable call chesaka id, name inko sari print chesaru . mari output enduku sir id and name okasare print ayyindi??

krishnalikith