Hello haiforhussain
Define your class to have a null referenced object as a static attribute and have the class of that attribute implement a static method. For example:
Code:
public class ClassOne{
public static ClassTwo two = null;
}
And
Code:
public class ClassTwo{
public static void doSomething(){
System.out.println("In the past I was a grasshopper. But now, I am the master!");
}
}
Then the following could be done:
Code:
public static void main(String[] arg){
ClassOne.two.doSomething();
}
This could be nice if you want to build a toolbox, i.e., you don't want to add objects to your project, but structured functionality. Personally, I have never found a need for this though. :)
Good luck ;)