//pk
In java, static methods are called just by prefixing the class name.
example:
class Student
{
public static int age;
public static void show()
{
System.out.println("this is show");
}
public void display()
{
System.out.println("this is display");
}
}
------------------------
class My
{
public static void main (String[]args)
{
//calling static methods: show() of student class
Student.show(); //calling static method
//accessing static variable age of student class
Student.age=32;
System.out.println(Student.age);
//calling non static method:display() of student class
Student s = new Student();
s.display(); //calling non static method by class instance
}
}