Can some one help me...I need help fast please.....>.<

This the the the Lane Class:

import java.util.*;

import java.io.*;

import java.*;

public class Lane

{

public String[][] lane = new String[10][3];

int car1 = 0;

int car2 = 0;

int car3 = 0;

int car4 = 0;

public int bool = 1;

Random random = new Random();

public String[][] addCar()

{

while(bool == 1)

{

Random random = new Random();

int randomInt = random.nextInt(4);

if(randomInt == 0)

{

car1++;

lane[0][0] = "<=>";

moveL1();

}

if(randomInt == 1)

{

car2++;

lane[0][1] = "<=>";

moveL2();

}

if(randomInt == 2)

{

car3++;

lane[10][2] = "<=>";

moveR1();

}

if(randomInt == 3)

{

car4++;

lane[10][3] = "<=>";

moveR2();

}

return lane;

}

return lane;

}

public String[][] moveL1()

{

int i=0;

int j=1;

while(bool==1)

{

for(int a=0; a<=10; i++)

{

String temp=lane[0];

lane[0]=lane[j][0];

lane[j][0]=temp;

return lane;

}

lane[10][0] = "";

break;

}

return lane;

}

public String[][] moveL2()

{

int i=0;

int j=1;

while(bool==1)

{

for(int a=0; a<=10; i++)

{

String temp=lane[1];

lane[1]=lane[j][1];

lane[j][1]=temp;

return lane;

}

lane[10][1] = "";

break;

}

return lane;

}

public String[][] moveR1()

{

int i=10;

int j=9;

while(bool==1)

{

for(int a=0; a<=10; i++)

{

String temp=lane[2];

lane[2]=lane[j][2];

lane[j][2]=temp;

return lane;

}

lane[0][2] = "";

break;

}

return lane;

}

public String[][] moveR2()

{

int i=10;

int j=9;

while(bool==1)

{

for(int a=0; a<=10; i++)

{

String temp=lane[3];

lane[3]=lane[j][3];

lane[j][3]=temp;

return lane;

}

lane[0][3] = "";

break;

}

return lane;

}

}

And this is the Tester class:

/**

* @(#)LaneTest.java

*

*

* @Jeff Cho

* @SID 307144283

* @created 2007/4/30

*/

public class LaneTest

{

addCar car = new addCar();

}

This program is suppose to simulate how a car move on a lane (in terms of array).

The Lane Class compiled perfectly.

But the LaneTest, have 1 error:

Invalid method declaration; return type need

I dont understand why, Please help me....

[2738 byte] By [Jeffski_kuna] at [2007-11-27 3:51:49]
# 1
where is the public static void man(String[] args) line at ?
Sourcea at 2007-7-12 8:55:49 > top of Java-index,Java Essentials,Java Programming...
# 2
How did it compile perfectly?String temp=lane[0];Here you're assigning a String [ ] to a String! How did that compile? You have this all over the place.
nogoodatcodinga at 2007-7-12 8:55:49 > top of Java-index,Java Essentials,Java Programming...
# 3

> This program is suppose to simulate how a car move on

> a lane (in terms of array).

>

> The Lane Class compiled perfectly.

>

> But the LaneTest, have 1 error:

> Invalid method declaration; return type need

>

> I dont understand why, Please help me....

1) Your question isn't more important than anyone elses - putting something like need help fast is only going to get comments such as" I was going to help but I guess I'm to late"

2) your subject line doesn't say anything about what the problem is

3) use code tags (highlight your code and press the code button.

4) post the exact error message not what you interpret it to be.

*Edited to remove all the excess*

Aknibbsa at 2007-7-12 8:55:49 > top of Java-index,Java Essentials,Java Programming...
# 4
Try "code" tagsThere's even a little button above the editor that will put them there for you ;)
xiarcela at 2007-7-12 8:55:49 > top of Java-index,Java Essentials,Java Programming...