|
Synchronize the main method
|
|
03-29-2008, 03:48 PM
Post: #1
|
|||
|
|||
|
Synchronize the main method
Can we sychronize the main method?
|
|||
|
03-29-2008, 03:55 PM
Post: #2
|
|||
|
|||
|
RE: Synchronize the main method
What is the use of making the main method synzhronized. main is the entry point for the application and I think only one thread will be accessing this method
|
|||
|
03-29-2008, 03:58 PM
Post: #3
|
|||
|
|||
|
RE: Synchronize the main method
Yeah. We don't need to synchronize the main method. But even if you add the synchronized modifier to the main method it would work.
[java] public class Main { public synchronized static void main(String args[]){ System.out.println("main method..."); } } [/java] |
|||
|
« Next Oldest | Next Newest »
|

Search
Member List
Calendar
Help




