There are a few problems with your code. One, the thread that will display the message has been started before you do any synchronization, and there is a good chance it will print the message before you even get a chance to lock anything. You have made a race condition.
Secondly, you are synchronizing the main thread on the created object. The actual thread you want to wait is not waiting, because it never called wait (only System.out.println()).
Take a look at this example, see if you understand how it works: