answersLogoWhite

0

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.

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.

User Avatar

Wiki User

16y ago

Still curious? Ask our experts.

Chat with our AI personalities

EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
JudyJudy
Simplicity is my specialty.
Chat with Judy
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake

Add your answer:

Earn +20 pts
Q: Difference between getmessage and getlocalizedmessage in exceptions Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp