This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Arrays

 
Mwenya Chongo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. am new at Java and am just teaching myself. I hope through the forums I will able to gather as much help and advise. To day I want top know how to declare an array in a class outside the main method. And how to declare the array in the constructor.

I hope am not being too... "£$%%^^&**((). This will be my starting point.

Thank you very much
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how to declare an array inside a method?
 
Colm Dickson
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The folowing is a good link. Arrays can be declares with a certain size and the you can explicitly assign values to each element or you can declare and assign values in one go using the curly braces as can be seen in the following link


http://download.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic