Need help with java assignment
Hello this is a Java assignment I've been given and I have no idea where to start, any help would be greatly appreciated.
[Java] package uk.ac.sheffield.com1003.kalah; public class MyKalahGameState extends - Pastebin.com This is the link to the code I've written so far and ill try to give an overview of what I need to do.
So the assignment needs me to complete my own game state and a test class testing the private methods that I implement to ensure that the public methods which are in the link work as they should. I'm not allowed to add any more public methods. This is a completely new problem to me and without previous experience I'm finding it hard to know where to start or what to do.
Re: Need help with java assignment
Trail: Learning the Java Language (The Java™ Tutorials)Hi allapologies, welcome to the forums.
For a start you need to have a class called Player, there are numerous references to it.
Things like line 13
wont work, firstly because there is no getName() method, secondly, if there was chances are this would return a String.
Player playerA = playerA.getName();
There are numerous declarations of Player playerA, Player playerB when there does not need to be. Each time you call this code it creates a new instance of Player when you what to refer to the existing two.
Have a look through the tutorials for information on Java. If you have a specific problem then come back to us.
Trail: Learning the Java Language (The Java™ Tutorials)