Can you call a superclass method without creating an instance of the subclass?
Yes, you can call a superclass method without creating an instance of the subclass if the method is static. Static methods belong to the class and not to any specific object, so they can be accessed using the class name.
Example:
class Parent {
static void display() {
System.out.println("This is a static method of the Parent class");
}
}
public class Main {
public static void main(String[] args) {
Parent.display(); // No instance needed
}
}