It sounds really stupid now, but I was working with threads in Java. There are two ways to implement a thread, either implementing the interface runnable or extending the class thread. I originally had a class that implemented runnable with a custom method called getState(). To initialize a thread while using runnable, you have to pass the runnable object to a thread as a constructor parameter. The class thread also has a method called getState() and I spent an embarrassing amount of time wondering why I had totally different values than expected.
Comments
It sounds really stupid now, but I was working with threads in Java. There are two ways to implement a thread, either implementing the interface runnable or extending the class thread. I originally had a class that implemented runnable with a custom method called getState(). To initialize a thread while using runnable, you have to pass the runnable object to a thread as a constructor parameter. The class thread also has a method called getState() and I spent an embarrassing amount of time wondering why I had totally different values than expected.