Nematodes, commonly known as roundworms, are a diverse phylum with more than 28,000 different species that have been distinguished. Roundworms are so diverse that they can be found in virtually any environment from salt water to fresh water, and at any temperature or elevation. Some nematodes are parasitic; others are not. All roundworms have digestive systems. They are divided into two classes, Adenophorea and Secernentea.

...
Roundworms live in soil and in water.

Adenophorea

Adenophorea, also known as Aphasmidia because of the lack of phasmids on their tails, are usually found in the water. They have simple excretory and digestive systems. This class of nematodes is considered to be less advanced, or less evolved, than the Secernentea. The males usually have two testicles. There are two subclasses of Adenophorea: Enoplia and Chromadoria.

Secernentea

Secernentea are the main class of roundworms. Some Secernentea are parasitic, while others are not. They have excretory and digestive systems, but they do not have circulatory or respiratory systems. This class of nematodes are mostly found in soil, not in water. This class is also sometimes called Phasmidia because they have structures, known as phasmids, on their tail, making them sensitive to chemicals. The males usually have a single testicle. There are three subclasses of Secernetea: Rhabditia, Spiruria, and Diplogasteria.

Similarities

Distinguishing the two classes of nematodes is difficult because they are very similar. There is very little difference between the most evolved of the species and the most primitive. Scientists have not come to a uniform decision on classifying nematodes. All nematodes have well developed reproductive systems. They all have round and smooth bodies that are unsegmented. All parasitic nematodes spend at least part of their lifetimes living in the soil. Nematodes are multicellular organisms and they all hatch from eggs.