Okay, I re wrote it and now I only have 1 error:
class SingleDimensionalArray
{
public static void main(String args[])
{
int a[]= new a[10];
a[0] = 1;
a[1] = 2;
a[2] = 3;
Type: Posts; User: Allicat
Okay, I re wrote it and now I only have 1 error:
class SingleDimensionalArray
{
public static void main(String args[])
{
int a[]= new a[10];
a[0] = 1;
a[1] = 2;
a[2] = 3;
And when I compile that program it comes up with 4 errors:
SingleDimensionalArray.java:6: not a statement
a[]=(1,2,3,4,5,6,7,8,9,19);
^
SingleDimensionalArray.java:6: ';' expected...
What is an index?
This is what I'm supposed to do:
A Java program using single dimensional array. Have a list of 10 numbers and fetch a value based on the index.
The second part is not very clear, so I ended up...