Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Arrays - Array concepts, array of objects, etc. HELP!!!!!  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone tell me how to make arrays and advanced arrays?
Also how to make arrays of objects, comparison of array values, and the arrays class in general?
Have a test tomorrow and am really confused about this. Please help.
Thanks Have a good day! 
 
Bartender
Posts: 770
27
Eclipse IDE Hibernate jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch!
Please go through The Java™ Tutorials. Will you please post the complete code you tried so far with the error (If there is any)?

Here are some links please go through them too, click here --> Ease Up  Show Some Effort Keep It Down

To attract and get help from more volunteers better go through all of them --> How To Ask Questions On Java Ranch 
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I'm new too and I'd like to share a brief look at the structure of a single dimensional array and a multidimensional array or arrays and advanced arrays as you called them.

A single dimensional array follows a format like this:

dataType[] variableName = new dataType[arraySize]
or
double[] numbers = new double[10];

where the word "double" is the data type and the word "numbers" is the variable name. There is only one set of square brackets, [], because this array is only one dimensional and the word "new" can be thought of as an extra requirement to declare the array.
If you want to read more on single dimensional arrays I'd recommend chapter 7, section 2, in the Java Programming 10th Edition book.

A multi dimensional array follows a format like this:

dataType[][] variableName = [AmountOfRows][AmountOfColumns]
or
int[][] multiNumbers = new int[10][10];

where the word "int" is the data type and the word "multinumbers" is the variable name, same as before. However, there are two sets of square brackets this time, [][], because this array is two dimensional and has rows and columns instead of just one row of variables.
If you want to read more on multi dimensional array I'd recommend you start at chapter 8, section 2, in the Java Programming 10th Edition book, same book as before

Good luck on your programming!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!