/* package whatever; // don't place package name! */
import java.util.* ;
import java.lang.* ;
import java.io.* ;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
}
public void m
( List
<? extends Object [ ] > objs
) { objs.
stream ( ) .
map ( oa
-> oa
[ 0 ] ) .
forEach ( System .
out :: println
) ; //compile error //array type expected
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCX0KCQogICAgcHVibGljIHZvaWQgbShMaXN0PD8gZXh0ZW5kcyBPYmplY3RbXT4gb2Jqcyl7CiAgICAgICAgb2Jqcy5zdHJlYW0oKS5tYXAob2EgLT4gb2FbMF0pLmZvckVhY2goU3lzdGVtLm91dDo6cHJpbnRsbik7IC8vY29tcGlsZSBlcnJvcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FycmF5IHR5cGUgZXhwZWN0ZWQKICAgIH0KfQ==
compilation info
Main.java:16: error: array required, but CAP#1 found
objs.stream().map(oa -> oa[0]).forEach(System.out::println); //compile error
^
where CAP#1 is a fresh type-variable:
CAP#1 extends Object[] from capture of ? extends Object[]
1 error
stdout