Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why would you avoid C++ keywords in Java?

Tags:

java

c++

keyword

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

Why would this be considered important?

like image 712
Joshua Swink Avatar asked May 20 '26 05:05

Joshua Swink


1 Answers

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.

like image 166
James Baker Avatar answered May 22 '26 19:05

James Baker