answersLogoWhite

0


Best Answer

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

15y ago
This answer is:
User Avatar

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
Continue Learning about Engineering

What is difference between exception and error in java and explain using a program?

Error occurs at runtime and cannot be recovered, Outofmemory is one such example. Exceptions on the other hand are due conditions which the application encounters, that can be recovered such as FileNotFound exception or IO exceptions


What is the difference between technology and process?

what is the difference between license and patent


What is the difference between an assembler and a translator?

what is the difference between an assembler and the translator


What is the Difference between HVAC and AHU?

What is difference between hvac and ahu


What is difference between BE and BTech degrees?

no difference

Related questions

What is the true difference between a vegetable and a fruit?

The main difference is that fruits have seeds and vegies don't. However, there are exceptions. e.g cucumbers, eggplants, peppers etc.


What are the significant difference between organic and inorganic compound?

Basically, organic compounds have carbon. Inorganic do not (though there are some exceptions).


What are the fundamental difference between organic and inorganic chemicals in the body?

Basically, organic compounds have carbon. Inorganic do not (though there are some exceptions).


What is the difference between organic and inorganic compounds based on structure?

Basically, organic compounds have carbon. Inorganic do not (though there are some exceptions).


Where is teen on teen sex legal?

In most place it's legal if they are over 16, but there are exceptions and the difference between them can be important as well.


Difference between organic and inorganic in terms of general property?

In general, organic compounds are those compounds which contain carbon (with few exceptions). Inorganic compounds do not


What is difference between exception and error in java and explain using a program?

Error occurs at runtime and cannot be recovered, Outofmemory is one such example. Exceptions on the other hand are due conditions which the application encounters, that can be recovered such as FileNotFound exception or IO exceptions


Difference between checked and unchecked exception?

Checked exceptions are exceptions which need to be handled explicitly. These are the ones which require a try-catchblock or a throws keyword.Unchecked exceptions are exceptions which have no obligation to be handled. A NullPointerException is one common example.


What is the difference between cold and hot densities?

For the same substance, it will be less dense at higher temperatures and more dense at colder temperatures. There are a few exceptions, for instance water between 0 and 4 degrees C.


The difference between a country and a continent?

a continent is usually land which is completely surrounded by sea, although islands are exceptions to this where as countries is a section of land which is ruled and governed by the same person


What is the difference between the weight of a fifth grader and the weight of a professional football player?

Most fifth grade football players weigh between 60-120 pounds. Most NFL players weigh between 200 and 325. Of course there are exceptions.


How will the density change if the temperature increased to 125?

The density of most substances will change if temperature is increased. The amount of change depends on the difference between the two temperatures.