The thing goes like this: after choosing the position of your ship, the game starts showing you a grid of gray squares in which you should be able to click on the gray squares and hit or turn the squares white and the top table will show your ships, but the The error only occurs when I have the classes inside packages or I don't know what happens, because when I run the classes together without being in a package and placing a fixed file path, the program works correctly. I'm not quite sure.
It's quite hard to say what happened when you don't include the error message(s) you got when running the code with explicit package declarations.
It's hard to guess what went wrong - especially when the link in Google Drive is not readable. When you have an error related to package definition it may be that the source code is not placed into directories according to the package name.
Here I am using plain javac and java - in real life a build tool such as Maven should be used, but that's another story.
Code for class A in package com.example should the be put into the directory :
Just like RM, I am unable to compile your code because some is missing. I can see some errors however. For example, the above is not a default constructor. I don't know whether it is a good idea to overload the constructor name like that.
I think you are wrong to use an Object and cast its elements when you could use a ShipPiece instead. It is also a bad idea to pass a reference to an array without taking a defensive copy.
I don't think the boolean called isTurn is the correct way to handle alternating players. And why is it volatile?
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, that will fit in a stocking