braces {} or brackets []?
brackets are used to declare an array (or point out the index of an array
example of brackets
Code:
int[] numArray = new int[5];
numArray[0] = 1;
numArray[1] = 7;
curly braces are used to chunk off sections of code as well as classes and namespaces...
example of curly braces:
Code:
private class demo
{
......
}
if(...)
{
.....
}
else
{
.....
}
for(.....)
{
.....
}
etc...
You can also have both in one line, the declaration of an array and then initialization...
example:
Code:
int[] numbers = new int[7] { 4, 7, 2, 1, 3, 3, 0 };
Judging from your other posts, I think it would behoove you to do some intro to Java lessons. There are some
here as well as additional resources in
this thread. A little bit of google can go a long way.