Little Background: Now, I have been a web developer (Not a professional, but some projects for fun) and I understand things about Java and C#. I have had class in Java and C# so it's not too unfamiliar. Plus I love to code. THIS IS NOT FORIEN TO ME!
I HAVE A THEORY!
Objective: Understanding Multi-dimensional arrays, using correctly, and learn what methods I need to take for this specific action.
Issue: I am doing a query in a class and I am wanting to return values in an ArrayList and letting another class access the information and using it. Plus I need to use any kind of Data Type (Major ones like: String, Int, Double, etc). Now, my only question I have, is HOW do I use them?
For instance (Idk who is familiar with PHP) however, in PHP, you can set KEYS in the array
<?php
$customer = array(){
"firstName" => "Tyler",
"lastName" => "burger",
};
?>
So I was needing something similar in Java. However I can not find anything, nor any way to really use arrays effectively without making tons of repetitive stuff. I understand how to use ArrayList<(DataType)>, but here are some things I do not understand.
ArrayList<ArrayList<String>> customers = new ArrayList<ArrayList<String>>(); ArrayList<String[][]> customers = new ArrayList<String[][]>();
Some of you might be thinking, "Ahh will just use normal arrays...". The problem stands, I am getting data from a database which will be adding things constantly to the database, so there is no true way to set an array before adding the data to the array. (I can not make the ResultSet go to backwards because I'm using SQLite.)
ANY help or information is GREATLY appreciated. Thank you for the time for reading this. =)

New Topic/Question
Reply



MultiQuote








|