because if you synchronize the main method it should return only one output isn't it?
When you synchronize on a lock, you synchronize on a lock, period. There is no magic of "one output", blah, blah, blah... Two threads must cooperate with each other. And the first requirement here is probably that they should actually synchronize on the same lock.
In this example, the new started
thread has synchronized on the new instance, and the main thread has synchronized on the class lock. These are not the same lock.
Henry