This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Java in General and the fly likes creating random mole and removing it. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "creating random mole and removing it." Watch "creating random mole and removing it." New topic
Author

creating random mole and removing it.

Mac Subedi
Greenhorn

Joined: Nov 11, 2011
Posts: 5
Here i Created Ovals and loop it until 3 . My question is how can i

1) Draw a Oval at a random location and
2) If there are more than 5 Oval present how can i remove a random Oval, So far i have done this:









I hope this question make sense whoever is trying to help me. Thank YOU













Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44524
    
  34
You would need to create an array of moles and remove a member of that array.
That is one way to do it. There are lots of others.

I think you ought to create a Mole class.
Mac Subedi
Greenhorn

Joined: Nov 11, 2011
Posts: 5
would you give me some hints in code. ThankYOU
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44524
    
  34
Mac Subedi wrote:would you give me some hints in code. ThankYOU
No. Sorry.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: creating random mole and removing it.
 
It's not a secret anymore!