We will describe in this tutorial about The static keyword in java language
In java programming language static is a keyword which is used mainly for memory management and it is an access modifier. Static can be applied in Java’s: field , method , inner class and nested class. Static is a reserve word in the Java programing language. Static key word can be used in various way in Java:
Static keyword can be used in:
Advantage of static keyword
It makes the program’s memory efficient (save memory).
The static variable can be used to refer to the common property of all objects.
Syntax of static variable
public static <variable_name>
static string name="kannan";
A static methods belongs to the class rather than object of a class.
Syntax of static Method
public static void method_name() { ................. ................. }
static void run(){ //codes }
program example static variable
There are other Java language keywords that are similar to this keyword
Usage of this statement in the Java language
How to find reverse number using method In this article, we will discuss the concept…
C# inverted full pyramid star pattern In this article, we will discuss the concept of…
C# Full Pyramid star pattern program In this article, we will discuss the concept of…
Program to count vowels, consonants, words, characters and space in Java In this article, we…
How to print multiplication table using Array in C++ language In this post, we will…
C Program to multiplication table using Array In this tutorial , we will discuss about…