Search code examples
javacamelcasing

Why doesn't the instanceof operator use camelcase notation?


Foo bar = new Foo();
if(bar instanceof Foo){
    ... // it's true
}

I was just wondering why we don't use camelcase notation (instanceOf) instead of how it is (instanceof).


Solution

  • instanceof is an operator and a reserved word, not a method or variable. Camel case is used in Java for method names and variable names.