Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can't you use variadic function parameters?

    public static Object[] createArray(Object... args) {
        return args;
    }
I haven't done any Java in a while, so I'm just piecing this together from StackOverflow examples (with compiling, of course).


Since Java 1.5, yes. Perhaps it's an issue of backwards compatibility.


*without compiling




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: