ср, 30 июн. 2021 г. в 18:26, Christopher Schultz <ch...@christopherschultz.net>: > > All, > > On 6/30/21 11:23, Christopher Schultz wrote: > > Mark, > > > > On 6/30/21 08:51, Mark Thomas wrote: > >> All, > >> > >> I wanted to get some feedback on a possible code clean-up. Currently, > >> we declare literal arrays like this: > >> > >> String[] array = new String[] { "value1", "value2", "value3" ); > >> > >> We could simplify these declarations to: > >> > >> String[] array = { "value1", "value2", "value3" ); > >> > >> [...] > > > > Hmm. Is there a minimum compiler version necessary to use that syntax? > > I've literally never seen it before. Maybe it's just always been there... > > Been there forever: > http://titanium.cs.berkeley.edu/doc/java-langspec-1.0/10.doc.html#11358
I also wondered. Just tested that it works with Java 6. More examples here: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html +1 to simplify. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org