Explain Semantic error

Semantic error: It is an error in the meaning of program. A statement might contain no syntax errors, however might still break the rules of Java language. For example, when ivar is an int variable, the shown statement is syntactically correct

ivar = true;

Though, it is semantically wrong, since it is illegal to assign a Boolean value to an integer variable.

   Related Questions in Programming Languages

©TutorsGlobe All rights reserved 2022-2023.