If you're using a system that uses breakpoints, it can be rather easy to find out where errors are coming from. If you find out that a particular line is creating an error, put it in a try block like this:
[tt]try {
// this line throws an exception
} catch (Exception e) {
System.out.println();
}[/tt]
Put a break point at the [tt]System.out.println()[/tt] line. From there, you can determine the values of all relative variables, and get a better idea of where your bug is coming from.
If your SDK doesn't have breakpoints, don't fret too much. Do the same thing, except in your [tt]System.out.println()[/tt], print out the values of any variables that might be pertinent. you might want to also call e.printStackTrace() to receive the stack trace (this is printed out in any case when the exception is not caught). Happy debugging!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.