tag:blogger.com,1999:blog-8712770457197348465.post4413000295713762944..comments2024-03-28T18:10:34.431-07:00Comments on Javarevisited: How to Create and Initialize Anonymous Array in Java? Examplejavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8712770457197348465.post-90853055576430772382016-11-28T21:09:32.657-08:002016-11-28T21:09:32.657-08:00erratum* call a method.erratum* call a method.Greghttps://ca.linkedin.com/in/gregbobrowskinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-82369359706953402612016-11-28T21:06:53.686-08:002016-11-28T21:06:53.686-08:00Totally agree with BramVdb. Anonymous array is a s...Totally agree with BramVdb. Anonymous array is a stretch, computer pseudoscience. Following the same logic one can write: a method like that:<br />some_name( new String("xx"), new Object(), new Double(7.3)); ... and afterwords name these variables in a function definition just like you did with an array. We can have anonymous everything that inherits from Object. So your trick is Greghttps://ca.linkedin.com/in/gregbobrowskinoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-89638292939718355132015-07-11T04:44:18.538-07:002015-07-11T04:44:18.538-07:00@BramVdb, Anonymous class is quite different than ...@BramVdb, Anonymous class is quite different than anonymous array. Here it refers to adhoc arrays which are created on demand. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-51693696793655834782015-06-28T04:14:27.152-07:002015-06-28T04:14:27.152-07:00There is no such thing as an "anonymous"...There is no such thing as an "anonymous" and "non-anonymous" array. I think you are trying to draw a parallel here to anonymous classes. And I think it's a really bad one.<br /><br />It's important to realize the difference between classes, instances and fields. A class is like a blueprint that can be instantiated mutliple times, resulting in multiple instances. And a BramVdbhttps://www.blogger.com/profile/07911994238297201073noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-82392579563218034412013-04-13T01:48:52.198-07:002013-04-13T01:48:52.198-07:00Hi Javin ,
Gr8 Article , one more thing that I wa...Hi Javin ,<br /><br />Gr8 Article , one more thing that I want to add is..There's no such thing as an "anonymous inner array" - what you've got there is simply an array creation expression.<br /><br />To use varargs arrays, you just change the method declaration like this:<br /><br />public class AnnonymousArrayExample {<br /><br /> public static void main(String[] args) {<brSARAL SAXENAhttps://www.blogger.com/profile/01084233786047386880noreply@blogger.com