+ 3
What is static in Java?
use of static
5 Réponses
+ 20
IDK What are you asking about?
As there's a static class, variable and keyword!
Static Class:
A static class or created inside a class is called static nested class in java. It cannot access non-static data members and methods. It can be accessed by outer class name. It can access static data members of outer class including private.
Static variable:
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.
static block:
Static block is mostly used for changing the default values of static variables.This block gets executed when the class is loaded in the memory. A class can have multiple Static blocks, which will execute in the same sequence in which they have been written into the program.
+ 10
@Pawan Maurya
I like java.
Unfortunately the challenges are only on the core java
+ 9
In short, these are the elements that are executed before any instance of the class is created. I recommend reading the documentation on this, this is an extensive question
+ 2
you play very well 😵
+ 1
I'm asking y do v use static?