Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Cannot find symbol java error (newbie question)

Reply
Thread Tools

Cannot find symbol java error (newbie question)

 
 
Roedy Green
Guest
Posts: n/a
 
      09-30-2007
On Sat, 29 Sep 2007 12:50:49 GMT, "Andrew Thompson" <u32984@uwe>
wrote, quoted or indirectly quoted someone who said :

>You do not have the first clue what I think.


It does not matter. I am insulting you by pointing out what a nutter
you appear to be to others in the hopes you will stop being so rude to
the newbies. You dish out so many insults a day, it seems odd you
whither at one mild one in return.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      09-30-2007
"Andrew Thompson":
>> You do not have the first clue what I think.


Roedy Green wrote:
> It does not matter. I am insulting you by pointing out what a nutter
> you appear to be to others in the hopes you will stop being so rude to
> the newbies. You dish out so many insults a day, it seems odd you
> whither at one mild one in return.


I want a nice clean fight. No hitting below the belt. Come out when the bell
rings. Now shake hands, and back to your corners. Marquis of Queensbury rules.

Ding.

--
Lew
 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      09-30-2007
On Sep 29, 2:34 am, Taria <(E-Mail Removed)> wrote:
> 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


Look at this SSCCE:

class MyClass {
Integer[] array = new Integer[10];

public void doSomething() {
array.intValue(); /* fails, calling on the array instead of the
element */
array[0].intValue(); /* succeeds */
for (int i = 0; i < array.length; ++i) {
System.out.println(array[i].intValue()); /* succeeds */
}
}
}


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      09-30-2007
Daniel Pitts wrote:
> Look at this SSCCE:
>
> class MyClass {
> Integer[] array = new Integer[10];
>
> public void doSomething() {
> array.intValue(); /* fails, calling on the array instead of the
> element */
> array[0].intValue(); /* succeeds */
> for (int i = 0; i < array.length; ++i) {
> System.out.println(array[i].intValue()); /* succeeds */
> }
> }
> }


These calls marked "succeeds", while they successfully compile, only succeed
at runtime if each invoked array element is non-null.

This is not relevant to the compilation issue but might be important to those
who forget that newsgroup examples sometimes intentionally omit details for
pedagogical purposes that would be problematic in actual production. In
production code one would anticipate a NullPointerException.

--
Lew
 
Reply With Quote
 
Taria
Guest
Posts: n/a
 
      10-02-2007

> To Taria. I am not offended, and intended the advice
> to help you.
>
> I hope my words did not cause you offence. If they did,
> I would be interested to hear why. It might not change
> the way I post, but it did somewhat surprise me that
> you thought any apologies were necessary.
>
> --
> Andrew Thompsonhttp://www.athompson.info/andrew/
>
> Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200709/1


Thanks Andrew, this message made me feel better and I appreciate you
asking why I felt that way.

My analysis of why is this: First, know that I was already feeling
bad at not being able to figure out the program's error and by the
time I come here, I'm fustrated. This forum gives me hope.

I know this is an informal way of online communication (forums in any
case) but if you were to compare, say the style of the SSCCE's web
page (the one you linked) and what you posted..they essentially say
the same thing...but in different ways. The state of 'feeling bad'
existed in both cases, but the SSCCE's webpage I enjoyed reading and I
walked away from it feeling ok about myself. If you want specific
examples, I can go into it...but in general that's it in a nutshell.

I understand you were trying to help now. Thank you.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Encryption Package) error: cannot find symbol symbol: class BaseNCode clusardi2k@aol.com Java 6 08-29-2012 08:33 PM
Java - cannot find symbol nalbertini Java 1 02-12-2011 07:59 PM
javac error when using jar file : cannot find symbol powah Java 5 03-22-2009 12:45 AM
Creating class gives "cannot find symbol" error luch Java 5 10-05-2005 04:13 PM
java:143: cannot find symbol Danny Java 1 05-26-2004 08:46 AM



Advertisments