T
Taria
Hello all!
I'm normally good at finding why a java compiler can't find a symbol,
the methods have different calling types in their parameters,
mispelling of a variable, certain letters were captialized while
others were not but this has me totally stumped. Here is a simplified
version of my program.
import java.util.*;
import java.lang.*;
public class myProg{
public static void main(String[] arguments) {
int size = 10; // arbritray size - test number
LinkedList [] bucketArray = new LinkedList[size];
// next try to insert the value into bucket array
//bucketArray[1] = array[0]; incompatible types (my first
attempt to assign a value )
Integer four = new Integer(4); //so now four is an object
bucketArray.insert(four,0); //cannot find symbol
} //end of main
class LinkedList{
private Node head;
private int length;
public LinkedList() {
this.head = null;
this.length = 0;
}
public void insert (Object data,int position){
System.out.println ("Node code here\n");
}
}
Essentially, I'm trying to initiialize the bucketArray with a value.
I really want the cell of the array to hold a string of characters but
for simplicity sake I made it into an integer for now just to get it
compiling. When I shortened this program to post it here, I took out
the existing Node class that I put in place, but I don't think this
should affect anything (at least I hope it doesn't.)
So, what is wrong? I am passing 2 parms, one object, the other an
int...I think I'm referencing it correctly to call 'insert' within the
LinkedList class. I've checked and rechecked it and frankly, I'm
stumped.
Sidenote: from past advice, I understand that the array is really
holding a reference in the array I created. That doesn't really
affect me, does it? Isn't that internal? Is there a special way to
specify whether it is a reference or whetehr it holds a specific
value?
Any help is again appreciated,
-t (the
I'm normally good at finding why a java compiler can't find a symbol,
the methods have different calling types in their parameters,
mispelling of a variable, certain letters were captialized while
others were not but this has me totally stumped. Here is a simplified
version of my program.
import java.util.*;
import java.lang.*;
public class myProg{
public static void main(String[] arguments) {
int size = 10; // arbritray size - test number
LinkedList [] bucketArray = new LinkedList[size];
// next try to insert the value into bucket array
//bucketArray[1] = array[0]; incompatible types (my first
attempt to assign a value )
Integer four = new Integer(4); //so now four is an object
bucketArray.insert(four,0); //cannot find symbol
} //end of main
class LinkedList{
private Node head;
private int length;
public LinkedList() {
this.head = null;
this.length = 0;
}
public void insert (Object data,int position){
System.out.println ("Node code here\n");
}
}
Essentially, I'm trying to initiialize the bucketArray with a value.
I really want the cell of the array to hold a string of characters but
for simplicity sake I made it into an integer for now just to get it
compiling. When I shortened this program to post it here, I took out
the existing Node class that I put in place, but I don't think this
should affect anything (at least I hope it doesn't.)
So, what is wrong? I am passing 2 parms, one object, the other an
int...I think I'm referencing it correctly to call 'insert' within the
LinkedList class. I've checked and rechecked it and frankly, I'm
stumped.
Sidenote: from past advice, I understand that the array is really
holding a reference in the array I created. That doesn't really
affect me, does it? Isn't that internal? Is there a special way to
specify whether it is a reference or whetehr it holds a specific
value?
Any help is again appreciated,
-t (the