If I declare a method static, does it mean only a class can call that method?

Yes, when you declare a method as static in Java, it means that the method belongs to the class itself rather than to an instance of the class. This also means that the method can be called directly on the class without creating an object of that class.

To clarify, when a method is declared as static, it becomes independent of any specific instance of the class. It can be invoked using the class name itself, without needing an object. However, it doesn't restrict access to the class only; it can still be called from both within the class and from external classes.

Here's an example to illustrate this concept:

```java
public class MyClass {
public static void myStaticMethod() {
System.out.println("This is a static method.");
}

public void myInstanceMethod() {
System.out.println("This is an instance method.");
}

public static void main(String[] args) {
myStaticMethod(); // Call the static method directly

MyClass instance = new MyClass();
instance.myInstanceMethod(); // Call the instance method using an object
}
}
```

In the above example, `myStaticMethod()` can be called directly using `myStaticMethod()`, whereas `myInstanceMethod()` requires an instance of the class, created by `new MyClass()`, to call the method on.

Remember, while static methods can access other static members (variables, methods, etc.), they cannot directly access non-static instance members since there is no specific instance associated with them. If you need to use instance-specific variables or methods within a static method, you would need to create an instance of the class inside the static method and then access the instance members through that object.