```class Foo class Bar``` Why I can't do `Foo() ==...
# getting-started
m
Copy code
class Foo
class Bar
Why I can't do `Foo() == Bar()`but can
Foo().equals(Bar())
?
j
Technically
==
is compiled to
equals()
, but that doesn't prevent the compiler from being "smarter". From what I understood, the operator form is actually more restrictive than the method call form by design