looking for some solutions? You are welcome.

SOLVED: Casting an unimplemented interface to an object


I have a class with the same methods implemented as the interface

public class MyClass {

String getString(final String stringName) {

This is the interface definition -

public interface MyInterface {

String getString(final String stringName);

Is it possible to cast the interface to the class object-

MyInterface interace = new MyInterface;
MyClass class = (Myclass) interface;

Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots

No comments: