Monday, March 30, 2015

How do I port "synchronized" functions from Visual J++ to C#?

Question:How do I port "synchronized" functions from Visual J++ to C#??

Answer: </P><P align=justify>Original Visual J++ code: public synchronized void Run() </P><P align=justify>{</P><P align=justify>// function body</P><P align=justify>}</P><P align=justify></P><P align=justify></P><P align=justify>Ported C# code: class C</P><P align=justify>{</P><P align=justify>public void Run()</P><P align=justify>{</P><P align=justify>lock(this)</P><P align=justify>{</P><P align=justify>// function body </P><P align=justify>}</P><P align=justify>}</P><P align=justify>public static void Main() {}</P><P align=justify>}

Tags:Interview Questions, Microsoft, C#,

Please submit your Interview Answer for the above Question via replying to this post. Thank you for visiting to our blog, Have a Good Day!.



Sponsor Advertisement



Hospital Management Software

Hotel Management System Software

Hotel Management System software is a web based system help to manage reservations, roomstays, bookings, guests, folios, invoices and billing etc. The software features include revenue management, booking calendar, guest relationship management, check-in & check-out, invoices and receipts etc...

No comments:

Post a Comment