Static Keyword: Most of the time static keyword in java use for memory management. We can use static keyword with variables, methods and also with block (Static block) . 1. Static with variables: If we declare static keyword with variables then it's called static variables . Static variables are use to access or refer common properties of all objects. The static varibels gets memory only once at the time of loading class loading. It makes program more efficient i.e., It saves memory. For example, static int length=100; 2. Static with method: If we use static keyword with method then it's called static method . The static method is belong to class rather than object of class. Static method can invoke or call without creating instance or object of class. For example, static void print(){ System.out.println("Welcome in Java"); } Examples of static variable, method an...
A blog about Java basic concept, Java Keywords, Algorithems, Loops, Conditional loops, Data Structure, Java collections, Database, OOPS concepts, Java Interface, Java String, Java Execption handling, Java Networking, Java AWT, Java Swing, Java Applet, Java JDBC, Java Multithreading, Java I/O, Java String, Java conversion, Java date. And we are going to explain every point in deep for better understanding.