Reputation: 479
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
).
Upvotes: 8
Views: 415
Reputation:
method name is defined as lowerCamelCase https://google-styleguide.googlecode.com/svn/trunk/javaguide.html#s5.2.3-method-names
and operators are predefined symbols
Upvotes: 1
Reputation: 878
because instanceof
is an operator, Camel casing
is meant for methods and variables
Upvotes: 1
Reputation: 393846
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.
Upvotes: 13