Hi there,
Obviously as indicated by my question I'm fairly new to programming and seeking some clarification. Now my question is why are keywords not called by class name? For example if I wanted to use the writeline method I first have to specify the namespace it belongs to(system) and then the class it belongs to (Console). Why are keywords exempt from this? why not ClassName.if(){} and instead just if(){}?
Afzaal Ahmad ZeeshanPosted May 9, 2019, 4:39 PM
Now, let us discuss why not the keywords. Because, keywords are the part of the program. You cannot override the behavior of a keyword. You cannot change what an if...else block, or what a try...catch block does. There is an operator overriding, function overloading, but they are sugar coated and provide a syntactical sugar coating around underlying "ugly" parts of the program.