Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Array covariance
public class Test {
class Parent {}
class Child extends Parent {}
public void accept(Parent[] parent) {
public static void main(String[] args) {
Test test = new Test();
test.accept(new Child[10]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment