Easy learning with example program codes

what is static method in java?

Static methods

Static methods represent the behavior of whole class. An instance of a class is not required to execute static methods. They can be called using class name.
Syntax: ClassName.methodName


 * This program is used to show that there is no need of an object
 * for accessing a static method. It can be called with class name.
 * @author CodesJava
class Display {
	//static method
	public static void display(){
public class StaticExample4 {
	public static void main(String args[]){
		//No need for object to call static method.



Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki