Input
Output
public class Staticmethod { static int a=6; static void square() //Static method { a=5; } public static void main(String args[]) { Staticmethod.square();//calling square method System.out.println("Area of the square: "+(a*a)); } }