Skip to content

Instantly share code, notes, and snippets.

@muanis
Created February 7, 2014 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muanis/8856248 to your computer and use it in GitHub Desktop.
Save muanis/8856248 to your computer and use it in GitHub Desktop.
public class TestClass {
public void methoda() {
List<ClassB> aList = new ArrayList<ClassB>();
ClassB b = new ClassB();
aList.add(b);
List<TestInterface> bList = new ArrayList<TestInterface>();
bList.add(b);
TestInterface zz = aList.get(0);
TestInterface zz2 = bList.get(0);
}
}
class ClassB implements TestInterface {
public void methodA() {
return;
}
}
interface TestInterface {
void methodA();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment