Semantic Error
Semantic Error
Home Compiler Data Structure C C++ C# Java SQL HTML CSS JavaScript
https://www.javatpoint.com/semantic-error 1/6
12/10/22, 10:06 AM Semantic Error - javatpoint
Semantic Error
During the semantic analysis phase, this type of error appears. These types of error are detected at
compile time.
Most of the compile time errors are scope and declaration error. For example: undeclared or
multiple declared identifiers. Type mismatched is another compile time error.
The semantic error can arises using the wrong variable or using wrong operator or doing operation
in wrong order.
Undeclared variable
int i;
void f (int m)
{
m=t;
}
https://www.javatpoint.com/semantic-error 2/6
12/10/22, 10:06 AM Semantic Error - javatpoint
int a = "hello"; // the types String and int are not compatible
String s = "...";
int a = 5 - s; // the - operator does not support arguments of type String
← Prev Next →
Feedback
https://www.javatpoint.com/semantic-error 3/6
12/10/22, 10:06 AM Semantic Error - javatpoint
Splunk SPSS
Swagger T-SQL tutorial
tutorial
Transact-SQL
Swagger
Preparation
Company
Interview
Questions
Company Questions
Trending Technologies
https://www.javatpoint.com/semantic-error 4/6
12/10/22, 10:06 AM Semantic Error - javatpoint
B.Tech / MCA
https://www.javatpoint.com/semantic-error 5/6
12/10/22, 10:06 AM Semantic Error - javatpoint
https://www.javatpoint.com/semantic-error 6/6