categories:
- 日常记录
tags: - Java
(String ...)
is an array of parameters of type String
, where as String[]
is a single parameter.
Now here String[]
can full fill the same purpose here but (String ...)
provides more readability and easiness to use.
It also provides an option that we can pass multiple array of String
rather than a single one using String[]
.
While String[]
can be passed into a method taking String...
as a parameter, two String[]
s cannot. There is no implicit array concatenation that takes place here
网友评论