public static void main(String args[]) { myMethod(); // i am calling static method from main() }
.
public static ? myMethod(){
you can have the return as an object. You create that object 'on fly' in your
function: if(int) return new object(){ int nr=.. }
same for string. But I am concerned that is an expensive solution...