Hi To cut short:
What I want is the Ball class which extend Thread and the main method which start the thread.
The output should be given that the numOfball initial value is 2 and after 2 it will...
Type: Posts; User: hellokitty25
Hi To cut short:
What I want is the Ball class which extend Thread and the main method which start the thread.
The output should be given that the numOfball initial value is 2 and after 2 it will...
Hi In my main program the inital value is 2 and I need to pass it to the class as shown below:
public static void main(String[] args)
{
Ball [] ball = new Ball[5];
int numOfball = 2;
for (int i...
Hi all instances should shared one value.That is the numOfball will be shared by the instances each time a thread is started.
If I do not set it,is there any other ways to get the numOfball in the main program?
Hi in the main program there is a return value which will change the value
numOfball= ball[i].getNum();
public class TestBall
{
public static void main(String[] args)
{
Ball [] ball = new Ball[5];
int numOfball = 2;
for (int i = 0; i < ball.length; i++)
{
Hi all
What I am trying to do is this:
The output should be:
Ball0 throw
Ball6 throw
Ball7 throw
Ball8 throw
Ball0 return
Hi all
Suppose I have a main method that do the following:
Ball [] ball = new Ball[5];
private int numOfball = 10;
for (int i = 0; i < ball.length i++)
{
ball[i] = new...