0

I'm studying how to use the FIs and the lambda expressions and I was wondering if I could compare two objects but of a different type such as an Integer object and a String object. I've seen them, sometimes, being used interchangeably like a Char becoming and Integer or a CharSequence becoming a String. That made me think about comparing them since they all come from the Object superclass.

Thank you.

1 Answers1

-1

It's not entirely clear to me what you're asking here. However, I would guess you saw a char being compared to an Integer when it was used to represent its Unicode value (cfr.: this question). The relationship between String and CharSequence instead is that of a class implementing an interface (check this for more information)

Community
  • 1
  • 1
DeusEx
  • 147
  • 1
  • 7