The Artima Developer Community
Sponsored Link

Java Answers Forum
cannot find symbol?......wats happening???

7 replies on 1 page. Most recent reply: Jul 16, 2008 6:48 AM by saidon conteh

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 7 replies on 1 page
saidon conteh

Posts: 8
Nickname: conteh
Registered: Jun, 2008

cannot find symbol?......wats happening??? Posted: Jul 10, 2008 2:36 AM
Reply to this message Reply
Advertisement
Here is the malfunctioning code....

public class Human
{
public Head myHead;
public Arm[] myArms = new Arm[2];
public Leg[] myLegs = new Leg[2];
/*
* Constructor for the Human class
*/
public Human(String name, String race, String gender, int age) {
/*
* use 'this' to refer to
* the current object being manipulated
*/
this.name = name;
this.race = race;
this.gender = gender;
this.age = age;

myHead = new Head();
myArms[0] = new Arm("RightArm");
myArms[1] = new Arm("LeftArm");
myLegs[0] = new Leg("RightLeg");
myLegs[1] = new Leg("LeftLeg");
} /*
* walk method
*/
public void walk(int steps){
for (int i = 0; i <= steps; i++){
myLegs[0].moveForward();
myLegs[1].moveForward();
}
}
/*
* declare and create a Human object
*/
public static void main(String[] args) {
/*
* new instance of the Human
*/
Human me = new Human("Putin", "yellow", "male", 58);
/*
* set string values to variables
*/
me.myHead.setHairColor("white");
me.myHead.setFaceColor("brown");

System.out.println("My name is Putin, am " +me.myHead.faceColor+ " and I have got " +me.myHead.hairColor+ " hair");
/*
* test walk method
*/
me.walk(5);
System.out.println("I walked 5 steps from position zero to position " + me.myLegs[0].getPosition());
}
/*
* declare variables
*/
private String name;
private String race;
private String gender;
private int age;
}


Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: cannot find symbol?......wats happening??? Posted: Jul 11, 2008 1:13 AM
Reply to this message Reply
Firstly cannot read your code as it is not indented properly and I don't have the energy to look at crappily formated code.

Secondly what in the blazing hell does "cannot find symbol?" mean. Are you getting a compile time error? Is this a String you saw on a sign-post while oggling a donkey at a farm strip show? Is it a random string you thought up? What?

Eloquently written questions supported by neatly formatted code will help us help you.

saidon conteh

Posts: 8
Nickname: conteh
Registered: Jun, 2008

Re: cannot find symbol?......wats happening??? Posted: Jul 14, 2008 4:56 AM
Reply to this message Reply
Firstly, this aint a reading contest. This is a programmers haven and I think you would be better off at the TOEFL site. I will give you the address in a bit. Secondly, if you knew a tiny lil bit of Java, you would know that a 'cannot find symbol' error is brought about because one has not imported classes mentioned in the package correctly. Now, with a bit of research, you would have known that. But because you were busy oggling a donkey at your fuckin' farm strip show, you missed that. I suggest if you got nothing positive to contribute here, pack up and go to the Middle East and go hang. Come to think of it, you would be better off becoming a suicide bomber. Two birds with one stone. But you wouldn't understand, again....damn!@

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: cannot find symbol?......wats happening??? Posted: Jul 14, 2008 5:26 AM
Reply to this message Reply
> Firstly, this aint a reading contest.

Note the text on the side of each post (Formatting your
code). Wonder why you din't get a quick response? There are plenty competent developers who visit this site. Have been a member for quite a while, and in most cases I've come across people get extremely frustrated looking at code that is not indented accordingly. "Reading contest"? What does that even mean?

>This is a
> programmers haven and I think you would be better off at
> the TOEFL site.

How does this relate to you not being able to format your code? If I was your team-lead/architect and you committed code like that to repository, I'd get you fired for incompetence.

>I will give you the address in a bit.
> Secondly, if you knew a tiny lil bit of Java,

Alas, I'm past the stage of getting compile time errors, that is so far back I can't even remember the accurate String that is spat out in error. Try using a modern IDE (IntelliJ's IDEA or Eclipse), it helps with the Automatic Imports and/or suggestions for imports.

>you would
> know that a 'cannot find symbol' error is brought about
> because one has not imported classes mentioned in the
> package correctly. Now, with a bit of research, you would
> have known that.

Glad you have learnt how to use Google, you could have done so initially before this ridiculous post.

> But because you were busy oggling a
> donkey at your fuckin' farm strip show,

OK, that was my bad. My apologies for kicking off the tasteless humour.

>you missed that. I
> suggest if you got nothing positive to contribute here,
> pack up and go to the Middle East and go hang.

Oooh, such anger. Have no clue what your incompetence has to do with me being from the Middle East (which I'm not by the way). Incompetence for most people does lead to frustration and the need to blame a particular group of individuals for your Short comings, on behalf of all ethnic minorities I apologize for you having a low IQ.

> Come to
> think of it, you would be better off becoming a suicide
> bomber. Two birds with one stone. But you wouldn't
> understand, again....damn!@

That last bit simply highlights your ignorance.

saidon conteh

Posts: 8
Nickname: conteh
Registered: Jun, 2008

Re: cannot find symbol?......wats happening??? Posted: Jul 14, 2008 8:54 AM
Reply to this message Reply
Got to give you marks for the composition. Well thought out, inspiring and I may also say think it also gave you the kicks just writing that rubbish. Anyway, I can see you have been a member since time immemorial with 451 posts to your credit. Kudos, keep up. Im quite pleased I don't know you because you seem a little touchy, maybe also petty considering your experience as you say of being an honorable member of Artima. As you correctly observed, im a newbie and for now I am comfortable using the basic IDE's like Scite, notepad etc. I think I would be better off leaving Eclipse, Netbeans and the rest to you oooh!..'past the stage of getting compile time errors, that is so far back I can't even remember'....member!@ Next time, don't even waste your precious time on my ridiculous posts. Would appreciate it alot because I suppose you got your hands full. What with oggling donkeys at your strip shows...(my bad too). Aaaah.....din't mean you are from the mid-east. You are pure African my friend. Malawian working in S.A? your choice. Piece of advice, if you got nothing to do, don't do it here. There are budding programmers who really need the help and I suppose that's why we have this site in the first place.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: cannot find symbol?......wats happening??? Posted: Jul 16, 2008 5:05 AM
Reply to this message Reply
1. allways post code with the right formating, that's not too much to ask for.

2. At least tell when and where you get the error.

3. think before writing. " ... if you knew a tiny little bit of java ..." usually pisses people of.

Follow rules 1 and 2 and someone might actually care to read your post and think about a solution.

follow 3 and you won't get snappy responses.

Apart from your code being unreadable without the propper formating, also some code won't be displayed correctly, since some elements of it will be used to format the page if you don't put the java tag before it.

Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: cannot find symbol?......wats happening??? Posted: Jul 16, 2008 5:12 AM
Reply to this message Reply
Apart from that - without reading the code - a unknown symbol usually means you are using a variable or method or variable which has not been declared.

saidon conteh

Posts: 8
Nickname: conteh
Registered: Jun, 2008

Re: cannot find symbol?......wats happening??? Posted: Jul 16, 2008 6:48 AM
Reply to this message Reply
Thank you very much. I had declared the variables and methods. I got to find out that the legs and arms classes had their constructor properties set as private.

Flat View: This topic has 7 replies on 1 page
Topic: how to use sessions Previous Topic   Next Topic Topic: How to run a Webservice Client program?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use