As odd as this may seem, in 1887 U.S. tariff laws made vegetables taxable, but not fruits. This caused some legal concerns regarding the tomato. In 1893, the U.S. officially declared the tomato a vegetable. The basis for this decision was that tomatoes are served as dinner dishes, not dessert dishes.
The tomato is the official state vegetable for New Jersey and the official state fruit for Ohio.
Poor tomato, no one can agree on what it is but if we look at the tomato in terms of what makes a fruit a fruit and what makes a vegetable a vegetable, then the tomato is a fruit. This is simply due to the fact that is has seeds. In this case, cucumbers, squash, pumpkins, walnuts, and green beans are all fruits too.
A tomato is definitely a fruit if you are talking about the actual scientific meaning of the word. Something is a fruit if, among other things, it has the seeds of the plant within it. Since the tomato has seeds in it, it's a fruit. (So, for that matter, is a cucumber.) Vegetables are things that come from some other part of the plant (like the leaves of a lettuce plant.)
But we usually only refer to sweet stuff as fruits. That is, I think, why people don't usually call it a fruit. We use it much more like a vegetable in terms of cooking.
When we consider tomato as a part of plant or tree classified in botany, tomato falls under the category of fruits, just like many other vegetables like bottle gourd, beans, drumsticks, cucumbers, okra, pumpkin, and chillies.
However as used in common language the word fruit is used for a fleshy, juicy part of plant used for eating raw and which is generally sweet, and is usually eaten raw without cooking. In contrast vegetable in general language refers to any part of plan which is used for eating, generally after cooking.
Though vegetables as understood in common language are used in cooking, many vegetables may be eaten raw also. Similarly some fruits, particularly when they are not fully ripe may be cooked and eaten.
Horticulturists define fruits as edible seed bearing structure that consists of fleshy tissues and is produced by plants that lives for more than 2 years without being replaced. In contrast, most vegetables are produced by plants that live for only one season.
Tomatoes (Solanum lycopersicum) are often confused as being a vegetable instead of a fruit because of the manner in which it is used in cooking and for eating.
Scientifically speaking it is a fruit because it develops form the ovary part of the plant (in the flower base) and has seeds within it.
When preparing tomatoes cooks treat them like vegetables and often classify them as one, but it is their scientific determination that is the real definition of the tomatoes status.