Anonymous Array in java - FindersAdda : Tutorials of Make Money, Computer or Internet

Monday, 20 November 2017

Anonymous Array in java

  • An array declared without name is called Anonymous array.
  • The main purpose of creating an anonymous array is just of one time use.
  • We can create Anonymous array as follow
      • new int[] {1,2,3,4,5};
  • While creating Anonymous arrays we can't specify the size of an Anonymous array.
  • We can also create Multidimensional anonymous array.

How to create Anonymous array?

In this program, I have created two anonymous array, one is one dimensional anonymous array and second is multidimensional anonymous array. I have taken two show() method in this program. In first show() method, we passed an one dimensional array and then print its element. In second show() method, we passed multidimensional array and then print its all element.

Output of Anonymous program

You may also like:

About Author


Author & Editor

Myself Sumit Kumar Gupta & 21 year's old person. I am a programmer and blogger. I spend much more time on programming and blogging and helps other programmers and bloggers.


Post a Comment

We are eager to see your comments.
Comment Rule :

1. Don't use any link in the comment box. If you have any problem related to link then contact me with the contact form.

2. Don't use the wrong word if you write the wrong word in comment box then it will get spam.