What is a static function in Java?

Short Answer
Views 3

Answer:

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


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

✅ Called using:


ClassName.display();

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Fundamentals: Building Strong Foundations, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.