In 1893 the United States Supreme Court tried to clarify the differences between a fruit and a vegetable by saying that vegetables are eaten as part of the main course of a meal, but fruit is eaten as an appetizer or dessert, or for a snack.
But as with so many words, there is one definition, which is correct according to the dictionary and another one which people use in everyday life. Sweet corn, for instance, is eaten as an appetizer, but most people would consider it a vegetable.
In botany, a fruit is the ripened ovary of a plant. (The ovary is the part of the plant where the seeds are kept.) So, strictly speaking, an acorn is as such a fruit as an apple. But, if you went into a store and asked for fruit, the store-owner would not offer you acorns. When we talk about fruit in everyday life, we mean the juicy fruits like apples, grapes, oranges and melons.
Vegetable’ has even more meanings than “fruit”. The word covers any kind of plant life, even including trees. But, again, in everyday life vegetable mean food like lettuce, carrots, cabbage and sprouts.