Can abstract classes within ordinary classes be implemented outside of this class? if so, how should they be implemented?

public class Holdwer {
    
    public abstract class getS{
        abstract void getSomeMesage();
    }

}

how to implement getS methods externally

Mar.01,2021

is it like this?

public class Holdwer {
    public getS getTheS() {
        return new getS() {
            @Override
            void getSomeMesage() {
                System.out.println("This is  getS");
            }
        };
    }


    public abstract class getS {
        abstract void getSomeMesage();
    }
}
Menu