Java int… Array symbol

As I've seen in method parameters before, it seems that any number of parameters are allowed to fill the array created at run time What is the official name of this language function? thank you!

public static void trace(View view,RecyclerTraceType type,int... parameters) {

    RecyclerTrace trace = new RecyclerTrace();
    trace.position = parameters[0];
    trace.indexOnScreen = parameters[1];
}

Solution

You are looking at the Java 1.5 varargs feature Under the hood, it's just an array with syntax sugar

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>