title: Difference between e.getMessage() and e.getLocalizedMessage()
body: <p>What is the difference between the <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Throwable.html#getMessage()" rel="noreferrer"><code>getMessage</code></a> and <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Throwable.html#getLocalizedMessage()" rel="noreferrer"><code>getLocalizedMessage</code></a> methods on Java exceptions?</p>
  <p>I am using these both methods to get the message thrown by the catch block while performing error handling.  Both of them get me the message from the error handling, but how exactly do these two differ?</p>
  <p>I did some searching on the Internet and found this answer on <a href="http://wiki.answers.com/Q/Difference_between_getmessage_and_getlocalizedmessage_in_exceptions_Java" rel="noreferrer">Answers.com</a>:</p>
  <blockquote>
  <p>Java Exceptions inherit their getMessage and getLocalizedMessage methods from Throwable (see the related link). The difference is that subclasses should override getLocalizedMessage to provide a locale-specific message.</p>
  <p>For example, imaging that you're adapting code from an American-English speaking company/group to a British-English group. You may want to create custom Exception classes which override the getLocalizedMessage to correct spelling and grammer to what the users and developers who will be using your code might expect. This can also be used for actual translations of Exception messages.</p>
  </blockquote>
  <hr />
  <p><strong>Questions</strong>:</p>
  <ul>
  <li><p>Does that mean <strong>language specific</strong> implementations? Like if I use <code>e.getLocalizedMessage()</code> for example my app in <strong>English</strong> - error will be thrown in <code>English</code>, if I use my app in <strong>Spanish</strong> - then error will be thrown in <strong>Spanish</strong>?</p>
  </li>
  <li><p>Need some clear explanation on where and when I can use these methods to my use/</p>
  </li>
  </ul>