Hello,
Rectangle r = Asteroid.getBounds();
Object of type Asteroid(class)
cannot find symbol
symbol: method getBounds()
thanks
Hello,
Rectangle r = Asteroid.getBounds();
Object of type Asteroid(class)
cannot find symbol
symbol: method getBounds()
thanks
Okay, in order for us to help you, we need more than that. What is this Asteroids class? What does it look like, what methods does it have? Did you import this class into the file where you are writing this code? Lots of questions we need answered before we can answer yours. Typically, its best to provide all the relevant code up front. In this case, the Asteroid class, and possibly even the method that contains the code that you did provide.
Does your Asteroid class extend java.awt.Shape? java.awt.Polygon? There are a few other classes that also have a getBounds().
If it does, then your code should be able to find the method .getBounds().
Also, it should find the method if it were explicitly defined within the Asteroid class.
thanks, changed the getBounds() method works now