How to write a test class to test my code?
4 I want a test class to test this class but i dont know how to write it and i tried to see online but i still couldnt figure it out.I wrote the code on BlueJ, i’m trying to create the set game.
4 I want a test class to test this class but i dont know how to write it and i tried to see online but i still couldnt figure it out.I wrote the code on BlueJ, i’m trying to create the set game.
The parameter arrayFreeCode is declared as an int in your method, yet you treat it as an int[].
you need to assign to an array element, but you were doing it wrong.
After quick searching around I assume you’re using DrJava and its Interactions Pane. You don’t need those parentheses in the run command. Try run Main customer.dat smartphone.dat instead. That will run the main method of class Main with arguments customer.dat and smartphone.dat Source
You almost got it. There are some errors though: you’re not iterating over all the chars of the password (i < password.length() – 1 is wrong) you start with a digit count of 1 instead of 0 you make the check that the count of digits is at least 2 as soon as you meet … Read more
id is of primitive type int and not an Object. You cannot call methods on a primitive as you are doing here : Try replacing this: with