filmov
tv
Java static variable, method, block, static inner class, interface static method

Показать описание
java static keyword is to create class specific methods and properties. We can use static at following places:
1. static variable - useful to create constants
2. static method - useful to create utility methods
3. static block - useful to initialize static variables and load other resources before instance creation. We can access only class static variables and methods in static block.
4. static inner class - it's almost same as variable, we can create instance just like using static variable.
5. static method in interfaces - this was introduced in Java 8, so make sure you are on Java 8 or higher version otherwise you will get compile time error.
1. static variable - useful to create constants
2. static method - useful to create utility methods
3. static block - useful to initialize static variables and load other resources before instance creation. We can access only class static variables and methods in static block.
4. static inner class - it's almost same as variable, we can create instance just like using static variable.
5. static method in interfaces - this was introduced in Java 8, so make sure you are on Java 8 or higher version otherwise you will get compile time error.
Static vs Non-Static Variables and Methods In Java - Full Simple Tutorial
Mastering Static in Java: Static variable, method & block
#39 Static Block in java
#37 Static Variable in Java
Static Variables in Java (Hindi) || Static Keyword in Java
static block in java | Learn Coding
#38 Static Method in Java
STATIC VARIABLES, STATIC METHODS & STATIC BLOCK - JAVA PROGRAMMING
Java Tutorial 2 | Java Basics | Encapsulation, Inheritance, Polymorphism and Abstraction | Java OOP.
Java static variable, method, block, static inner class, interface static method
P30 - Static and Non static in java | Core Java | Java Programming |
Static in Java Tutorial #75
Static Variables and Static Methods in Java
#4.6 Java Tutorial | Static Keyword
L22-1: Java Static Keyword | Static Variable, Static Method, Static Block | Java Programing Lectures
Static keyword in Java - Static variables, Static Methods and Static Blocks in Java
Local, Static and Instance variables in Java | Learn Coding
Java - Members of Class, static, non static, variable, blocks, methods, constructors- Practical Demo
Static Methods in Java (Hindi) || Static Keyword in Java
Static and Non Static Variables in Java | How to call Static and Non Static variable in Java
static block in java | static keyword (Hindi)
Static Method In Java Tutorial #76
#38 Static Keyword in Java | In Tamil | Java Tutorial Series | Error Makes Clever
Static Keyword in Java | With Examples | Blocks, Variables, Methods and Classes
Комментарии