Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ibthaj Mansour   on Jun 21 In Java Category.

  
Question Answered By: Asir Hashmi   on Jun 21

They are telling the compiler that an array is to be used.
If you have int[] matrix = new int[5]; then you're creating
an array of integers with 5 elements. The first int[] set of
brackets says hey I'm an array but I'm not telling you how
big I am. The second set of brackets  in new int[5] says
we want a new object an array of integers that will be 5
integers long. I hope this has helped a little bit.

Share: 

 

This Question has 5 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Confused about brackets (when used with String command) Or get search suggestion and latest updates.


Tagged: