I switch back and forth between Java and C++ in my current job, and as a result I tend to use ‘bool’ in Java instead of ‘boolean’. I program in Emacs, which highlights ‘bool’ in a declaration the same as any other type, so I don’t tend to catch the error until compile time.
Is there any way to get java-mode to highlight ‘bool’ for me so that I can catch the error while I’m writing the code?
Add this to your .emacs: