A lot of annoying cast errors.
My buildTree method might work but it seems to have several annoying cast errors.
Somebody please help!
Enter an expression.
3+4+5
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Incompatible conditional operand types String and Double
Cannot cast from StringBuffer to double
Incompatible conditional operand types String and Character
Cannot cast from StringBuffer to char
Cannot cast from boolean to char
Type mismatch: cannot convert from char to boolean
Type mismatch: cannot convert from Character to OperatorNode
Cannot cast from StringBuffer to char
Cannot cast from StringBuffer to char
Type mismatch: cannot convert from Character to OperatorNode
Duplicate local variable c
Cannot cast from StringBuffer to char
at projectOfDoom.Expression_Tree.buildTree(Expression _Tree.java:72)
at projectOfDoom.Test_Expression.main(Test_Expression .java:24)
HELP!!!!
Re: A lot of annoying cast errors.
Not everyone is following you other several posts where the code for this method may be listed. Please post the relevant code (and try to post only the relevant code). And SHOUTING things such as HELP won't speed anything up, and could completely turn off some who wish to help (eg its not very good forum behavior)
Re: A lot of annoying cast errors.
ok, what's wrong now?
I figured that I need to have in-order traversal or something like this:
Code java:
public void inOrder()
{
if (left!=null)
left.inOrder();
System.out.println(data);
if (right!=null)
right.inOrder();
}
for the toString() method, but I don't know how I'd set that up.
The build tree might work, if I could deal with all the cast exceptions.
And btw, I meant that one thread as a practical joke.
I was in a humorous mood. It often comes due to large amounts of stress needing to be relieved.
That and I have ADHD and Aspergers and don't know proper social behavior, especially as my medicine wears off as the night goes on.
Sorry.
Wasn't trying to break the rules.
Re: A lot of annoying cast errors.
Quote:
That and I have ADHD and Aspergers and don't know proper social behavior, especially as my medicine wears off as the night goes on.
Sorry for the off-topic but, omg that is crazy. I was diagnosed with ADHD and Aspergers like 3 years ago. Fricken sucks man, I hate autism. What meds they have you on? I'm on Vyvanse, went from a C student to a Straight A student as soon as I started taking that.
Re: A lot of annoying cast errors.
Re: A lot of annoying cast errors.
Quote:
Originally Posted by
javapenguin
Ritalin I think.
Thats some rough shit. Although I think Vyvanse is known for pushing already stressed-out people over the edge. For me, it has just mellowed me out and just generally improved my quality of life and mood. It also works as one hell of a pain killer, which is great for my chronic spine disorder. Also non-addictive. I usually don't take my meds on weekends and I function just fine, just can't get as much done in a day. I don't take them on the weekends bc I've learned that if I don't have anything to keep myself occupied while on the meds, the day is like a never ending hell.
Re: A lot of annoying cast errors.
Are you guys going to help or just stare at the thread? I'm close to giving up. I'm so tired!
>:D<:-L:-L:-h#-o:!!~X(|-)|-)|-)(:|(:|(:|(:|(:|