The Greek formation of heavily armed infantrymen was called a phalanx.
A phalanx was a dense rectangular formation in which heavily armed infantry, usually hoplites, stood in close ranks. Soldiers overlapped their large shields and presented rows of spear points toward the enemy. The formation depended on discipline and cohesion: each warrior’s shield protected part of the man beside him, so gaps or panic could quickly weaken the entire line.
The Greek hoplite phalanx became especially important during the Archaic and Classical periods. It worked best on relatively level ground, where troops could advance without losing alignment. At Marathon in 490 BC, Athenian hoplites used a phalanx effectively against the Persian army. The Thebans later adapted phalanx tactics at Leuctra, while Macedonian armies under Philip II and Alexander the Great used longer sarissa pikes in a related formation.
A hoplite was the heavily armed soldier, not the formation itself. A trireme was a type of ancient warship, and cavalry fought on horseback. The word phalanx therefore describes the massed infantry arrangement, while hoplite identifies the classic Greek warrior who commonly formed it.