Are the methods being called? Add some println statements to each method and constructor to print a message when it is executed so you can see if the methods are being executed.
Type: Posts; User: Norm
Are the methods being called? Add some println statements to each method and constructor to print a message when it is executed so you can see if the methods are being executed.
Please post the program's output and add some comments to it that describes what is wrong with the output and show what the output should be.
Is it defined to throw an exception? If so, put it in try/catch for that exception.
It depends on the methods. If they are defined to throw an exception, then you would need to be ready to handle that exception by putting the calls to the methods in a try/catch block.
What about the main() method?
How are you executing the code? If you try to execute a class without a main method the java command will give an error message. So if you have a println in the main()...
Did you add printlns to all the methods and constructors?
Did any of them print out a message?
They won't print anything if they are not executed. Check the code to see why none of the...
Where is the execution flow going in the program? Add some println statements to all the methods to print to a message when they are executed. Check that the code is calling the methods that you...
ClassWithMethod cwm = new ClassWithMethod(); // create instance of class
You need to create an instance of the class to be able to call a non-static method in that class.
Please Edit your post and wrap your code with
<YOUR CODE HERE> to get highlighting
To execute a class using the java command, the class must have a correct main() method.
Please post the full text of the compiler error message.
What happens when you try to execute the program? I don't see a main() method.
The compiler sees that the variables are incompatible types.
It can not find the methods: getKey and getValue in the class: Map.
Please post the full text of the error messages.
Or explain what the problem is.