interface MyInterface
{
public void run ( ) ;
public void run2();
}
class MyClass // does not implement MyInterface
{
public void run ( )
{
System .
out .
println ( "Hello World!!!" ) ; }
}
class MyImplementationClass extends MyClass implements MyInterface
{
// no implementation of run() here
// implements run2()
public void run2() {
System .
out .
println ( "Hello World from run2!!!" ) ; }
}
class Main
{
public static void main
( String [ ] args
) {
new MyImplementationClass ( ) . run ( ) ;
new MyImplementationClass ( ) . run2 ( ) ;
}
}
CmludGVyZmFjZSBNeUludGVyZmFjZQp7CglwdWJsaWMgdm9pZCBydW4gKCApIDsKCQoJcHVibGljIHZvaWQgcnVuMigpOwp9CgpjbGFzcyBNeUNsYXNzIC8vIGRvZXMgbm90IGltcGxlbWVudCBNeUludGVyZmFjZQp7CglwdWJsaWMgdm9pZCBydW4gKCApCgl7CgkJU3lzdGVtIC4gb3V0IC4gcHJpbnRsbiAoICJIZWxsbyBXb3JsZCEhISIgKSA7Cgl9Cn0KCmNsYXNzIE15SW1wbGVtZW50YXRpb25DbGFzcyBleHRlbmRzIE15Q2xhc3MgaW1wbGVtZW50cyBNeUludGVyZmFjZQp7CgkvLyBubyBpbXBsZW1lbnRhdGlvbiBvZiBydW4oKSBoZXJlCgkKCS8vIGltcGxlbWVudHMgcnVuMigpCglwdWJsaWMgdm9pZCBydW4yKCkgewoJCQlTeXN0ZW0gLiBvdXQgLiBwcmludGxuICggIkhlbGxvIFdvcmxkIGZyb20gcnVuMiEhISIgKSA7Cgl9Cn0KCmNsYXNzIE1haW4KewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKCBTdHJpbmcgWyBdIGFyZ3MgKQoJewoJCW5ldyBNeUltcGxlbWVudGF0aW9uQ2xhc3MgKCApIC4gcnVuICggKSA7CgkJCgkJbmV3IE15SW1wbGVtZW50YXRpb25DbGFzcyAoICkgLiBydW4yICggKSA7Cgl9Cn0K