If you declare an array of strings in java like this
String[] words;
That just gives you a reference correct?
now, I am coming from a background in C, so I know that an array of "strings" in C are pointers to pointers, or an array of arrays. However, I am wondering how JVM uses this declaration... Is it just a single reference? Then when you give it sufficient memory, it will give the strings different lengths as well?
It's kind of hard for me to describe but I know that Strings are just arrays of characters, so how does the JVM determine how long the strings are before allocating it? Does it reallocate a whole new array of strings with a new updated string length.
char array[6][6]; //in C this is necessary because it needs to know the column and row length
similar to this
char* array[5]; // you still need to malloc the slots in the array for a two dimensional length to be achieved
but in java I dont get how this can work
String line = null;
try {
while ((line = bfr.readLine()) != null) {
if (StringUtils.isBlank(line))
continue;
System.out.println(line);
String[] chunks = line.split(","); //this line right here, how does JVM allocate proper memory
MindsparkPartnerCode record = new MindsparkPartnerCode();
record.setIEFFCode(chunks[0]);
records.add(record);