Cadena... en Java [duplicado]
Frecuentes
Visto 120 veces
0
I was reading a tutorial on Vogella, and I noticed the notation String... being used in a method declaration. I tried googling it without success. Can somebody explain what it is?
protected String doInBackground(String... urls) {
String response = "";
for (String url : urls) {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
try {
HttpResponse execute = client.execute(httpGet);
InputStream content = execute.getEntity().getContent();
BufferedReader buffer = new BufferedReader(new InputStreamReader(content));
String s = "";
while ((s = buffer.readLine()) != null) {
response += s;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return response;
}
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas java android or haz tu propia pregunta.
Buscar
varargs
. What did you try to google? - Sotirios DelimanolisString... will represent multiple strings as an array. - Daniel Bo
"String triple dot java" on Google would give you the solution much more faster than asking here. :) - Alexis C.
Buscar en docs.oracle.com/javase/1.5.0/docs/guide/language/varargs.html - Rakesh KR
Thanks guys! I just googled "String..." - Lalit Jain