Why can't we use a keyword as a variable name? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why can't we use a keyword as a variable name?

15th Sep 2019, 6:03 PM
Mukinda Deshmukh
Mukinda Deshmukh - avatar
2 Answers
+ 6
If you reserved a specific table at a restaurant and when you arrived somone else was eating there you wouldent like it right? It's the same with java there are some words that java has reserved and if you use them it makes java unhappy because they belong to him 🥺 😁
15th Sep 2019, 7:31 PM
D_Stark
D_Stark - avatar
+ 2
because it confuses the compiler
15th Sep 2019, 6:05 PM
Anton Böhler
Anton Böhler - avatar