Professional Documents
Culture Documents
Discussion Forum Unit 1
Discussion Forum Unit 1
Discussion Forum Unit 1
in a program. When a program has a syntax error, its output can't be compiled. It can also make the
commands unclear or unintelligible to the computer. For instance, if we're writing a program with a
line of code that doesn't include a semicolon, then we might have a syntax error.
The semantics error in a program is a type of programming language that considers whether or not a
statement is valid. It then reads the statement and validates it, and if it is, it will execute it. Although
a semantic error can be run and interpreted, it can also lead to an incorrect result. This is why it's
important to analyse the program in run-time whenever it has one.
The types of semantic errors that can occur are as a result of a mistake in the variable or an
operation in the wrong order. They can also be caused by an operator being wrong. Although we can
have a valid syntax, if an operator is not right, then the program will get an error.
Syntax example:
System.out.println("My name is : !)
Semantic example:
Reference(s)
Eck, D. J. (2019). Introduction to
programming using Java, version
8.1. Retrieved from:
http://math.hws.edu/javanotes.
Reference(s)
Eck, D. J. (2019). Introduction to programming using Java, version 8.1. Retrieved from:
http://math.hws.edu/javanotes.