Debashis jain

Greenhorn
+ Follow
since Mar 24, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Debashis jain

When I run this, I get only one circle (sometimes none...)
if i set radius = generator.nextInt(MAX_DIAMETER) + 1;

But if i replace MAX_DIAMETER which is 600, to something small maybe 100.
radius = generator.nextInt(100)+1;
than i get 5-10 circles...

What am i doing wrong??



The radius of the circle is (diameter/2)
"generator.nextInt(MAX_DIAMETER) "when you are using this function that's mean you are expecting a random number from 0-600
so when you write the code diameter=2*radius....actually the diameter at most of the time becomes as big as 1200,and your panel size is (600,600) so it won't suit the created circles.
12 years ago

12 years ago
@ sudip bose
In java the class from where we derive new classes is primarily known as the 'superclass',and the derived class is known as the 'subclass'.
parent and child concept is mostly used in the c++ language
That's why using of child and parent is not supported.
13 years ago