I want to ask if below is possible in JAVA
. I think the code is self-explanatory, if not, don't hesitate to ask.
import java.util.List;
public class NewClass {
public static void main(String[] args){
int x = 0;
int y = 1;
int z = 2;
printer([x,y,z]); //if somehow this is possible in JAVA?
}
private void printer(List num){
num.stream().forEach((i) -> {
System.out.println(i);
});
}
}