Hi,

If I have a class with a static synchronized method
and a class with singleton pattern doing the same
function, wont the 2 be same, what may be the
performance issue, what should we use in programs,
The method i want to use is synchronized, so that no 2
classes can access it a time, and hence create some
weird results.

This is what my classes will look
Class with static method
public class MyString
{
        public static synchronized  String
removeEscapeChar(String inputString)
        {
          // my logic here
        }
}

Singleton pattern class

public class MyString
{
private static MyString instance;
public static MapsContextData getInstance()
      {
        return instance;
      }
public String removeEscapeChar(String inputString)
        {
          // my logic here
        }

}


=====
A$HI$H

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to