A capacitor is a passive two-terminal electrical component that stores electrical energy in an electric field. A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. Diode is a semiconductor device with two terminals, typically allowing the flow of current in one direction only.