Final answer:
A lexical error is an error detected by the lexical analysis/Scanner stage in Java or C++.
Step-by-step explanation:
An error that is detected by the lexical analysis/Scanner stage in Java or C++ is a lexical error or lexical anomaly.
This occurs when the code includes symbols or sequences of characters that are not recognized by the programming language's lexical rules.
For example, in Java, if an identifier starts with a number, it will be flagged as a lexical error because identifiers should start with a letter or underscore.