Yes, compounds have a definite composition. Compounds are pure substances that are composed of two or more elements that are chemically combined in fixed proportions by mass. This means that the ratio of the masses of the elements in a compound is always the same, regardless of the amount of compound.
For example, water is a compound that is composed of hydrogen and oxygen. The ratio of the mass of hydrogen to the mass of oxygen in water is always 2:16, or 1:8. This means that for every 2 grams of hydrogen in a compound, there are always 16 grams of oxygen present.