A botanist’s definition of fruits is that they are nothing but a mature, seed bearing ovary of a flowering plant. Any seed containing vegetables like tomatoes or eggplants are actually fruits. Nuts are a special kind of fruit. While some fruits like apples, berries etc are moist and fleshy, others are dry. Nuts are examples of dry ones. Thus nut is a fruit with a hard shell and one seed within. The hard outer shell of the nuts is called pericarp and the oily meat of the nut inside is the seed.
A true nut does not crack open to release its seed when the fruit is mature. The seed is released when the fruit wall decays or digested by a living organism. By that definition, the so called nuts like walnuts, almonds, coconuts are actually not nuts but drupes. Drupe is again a type of fruit with thin outer layer, fleshy and thick middle layer and hard, stony inner layer. Peanut is again not a nut but is a legume. Almonds, pistachios, Brazil nuts, pecans, cashews are again not ‘true’ nuts. These are just the edible parts of various other kinds of fruits.
Acorns from the oak trees and hazelnuts are most common examples of kinds of fruits that are classified as nuts. Acorn has a single seed enclosed inside a hard shell.