开发者

Why would you avoid C++ keywords in Java?

A popular editor uses highlighting to help programmers avoid using C++ keywords in Java. The following words are displayed using the same colors as a syntax error:

auto delete extern friend inline redeclared register signed sizeof
struct template typedef union unsigned operator

Wh开发者_StackOverflow中文版y would this be considered important?


To avoid confusion. The largest migration path in the entire industry over the last 15 years was from C++ to Java. Thus, it would be wise to avoid using those words in a new context where they no longer mean anything.


Maybe the editor developers were lazy and used a common set of reserved keywords across languages?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜