call a object not a class java code example
Example: call method of another class without creating instance in java android
((BaseActivity) activity).showCart();
//class name context method name
((BaseActivity) activity).showCart();
//class name context method name