Are you asking how to write an if statement?
See the tutorial: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
--- Update ---
...
Type: Posts; User: Norm
Are you asking how to write an if statement?
See the tutorial: The if-then and if-then-else Statements (The Java™ Tutorials > Learning the Java Language > Language Basics)
--- Update ---
...
The numbers in the array have no meaning for me.
Can you answer this question?
What value(s) in the array means that it is OK to move a car there?
Use a if statement to detect if the array at...
How do you know there is a car in the location? What is in the array?
The Arrays class's deepToString() method is useful for printing out the contents of a 2 dim array for debugging:
...
Can you use an if test to detect if the location is already occupied before changing it?
Please edit your post and wrap your code with
<YOUR CODE HERE>
to get highlighting and preserve...