Puzzle!

Volvió el puzzle! Esta vez es fácil, ya que es una practica común, pero me encontré con mucha gente que no sabia de esto. Por favor, que alguien me explique por qué funciona el siguiente código.

List frutas = new ArrayList(){{ add("Manzana");add("Naranja");add("Pera");}};
This entry was posted in Jokes. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

One Comment

  1. Posted 24/04/2009 at 11:58 PM | Permalink

    bueno, como pediste por favor te digo :P
    es una clase anónima con un bloque de inicialización dentro, que está llamando a this.add()
    :D está bueno, nunca lo había visto

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Captcha
Enter the letters you see above.

35665 pages viewed, 42 today
17305 visits, 10 today
FireStats icon Powered by FireStats