Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Probably an easy newbie Question about casting

Status
Not open for further replies.

Aleena

Programmer
Oct 3, 1999
27
US
Hi there,<br><br>I am having some difficulty with a lab assignment and I cannot figure out what I am doing wrong. I am trying to cast an Object off my stack to a point. The original object pushed on the stack was a Point.<br><br>First I tried to just pop it off the stack<br>loopPoint = moveStack.pop();<br><br>Of course it says I need an explicit cast..<br>So I change it to <br>loopPoint = Point(moveStack.pop());<br><br>So now it tells me that Method Point(java.lang.Object) is not found in my class. <br><br>Why is it treating my cast as a method call? Am I doing something wrong in my casting? Any help that anyone can offer would be greatly appreciated. Otherwise I think I may end up in a mental institution :p<br><br>If you need to know anything further about my code, let me know.<br><br>Thanks,<br>Aleena
 
DOH!!!<br><br>Nevermind.. I have my parantheses in the wrong place.. sheesh.<br>Works fine now :)<br><br>Aleena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top