Welcome to the Ranch!
You can't do anything with
def outside of static block of
abc.
You need to declare
def outside of static block of
abc.
If you really wanted you could:
1. Have
def implement an interface.
2. Create a static variable of the type the interface in
abc;
3. Assign an instance of
def to the variable.
But I don't see a reason to do this. Just define
def as a static nested class of
abc.
By the way,
you should use meaningful names for your classes.