Alternate threads to print even and odd numbers
I have two comments of the tweaking kind:

1) any variable that is shared between threads has to be volatile. this is true even for static variables that have one value throughout the JVM (actually it is per class loader but this is irrelevant here). The reason for that is that threads can locally cache the value of variables.  volatile variables force the thread to read the global value each time. 

You might also want to take a look at AtomicInteger which is an int that is guaranteed to be incremented synchronously and that has the same value for all running threads.

2) while synchronized will work, Java concurrency package has several Lock mechanisms that allow for better control over the synchronization process.  of relevancy here are ReentrantLock, ReadWriteLock.