Home / Questions / What is a static function in Java?
Explanatory Question

What is a static function in Java?

👁 3 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

A static method belongs to the class, not to objects.


static void display() {
    System.out.println("Static method");
}

✅ Called using:


ClassName.display();