Java Array input and length -


does java array have assigned length in beginning? or can dynamic , accept unlimited amounts of data until user decides enough?

everywhere length defined... example

public static void main(string[] args)  { int a[] = new int[10];  system.out.println("please enter number: "\n);  } 

instead of having 10, possible @ time in future when user decides entering number, -1, array complete? therefore, user can continue input information because not know how information enter array. did find in 1 place using (int ... number), viable way of declaring no declared amount?

java arrays have fixed length. if want can grow needed, suggest using arraylist, backed array, , hard work you.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -