Cadena... en Java [duplicado]

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;
}

preguntado el 28 de enero de 14 a las 18:01

Buscar varargs. What did you try to google? -

String... will represent multiple strings as an array. -

"String triple dot java" on Google would give you the solution much more faster than asking here. :) -

Thanks guys! I just googled "String..." -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.