What are language constructs?

What are language constructs?

Language constructs are building blocks of a programming language. You have use them as per their syntax and the compiler can understand their functionality. The below is one of the example of language construct.

if(condition)
{
       //statements
}
else
{
     //statements
}

For the above if statement to work, the syntax has to be followed, else the compiler cannot understand and throws an error. Every programming language has language constructs and in one way or the other their interpretation is the same. As they are built into the language, their execution is pretty fast.

Wikipedia says --

"A language construct is a syntactically allowable part of a program that may be formed from one or more lexical tokens in accordance with the rules of a programming language." 

Post a Comment

0 Comments