package Connector; public class MySomeClass extends Host.SomeClass { // How we'll get everyone to make MySomeClasses // is unclear to me but I continue anyway // an inner class to implement the inner_readOp() ShowAccessAPPC.DataToAccess dta = new ShowAccessAPPC.DataToAccess() { public Object inner_readOp() { return expected_get_str(); } public Object get_host() { return Host.SomeClass.this; } } ; // rename the old method public String expected_get_str() { return super.get_str(); } // override the replaced method. public String get_str() { return (String) dta.readOp(); } public static void main(String[] args) { System.err.println(new MySomeClass().get_str()); } }