Formal languages are sets of strings constructed from a given alphabet and defined by a set of rules or grammar.