0

Is it a good programming practice to use Class.cast() method instead of (Class) casting?

What are the pros and cons of the two approaches. What are pitfalls of the both of them?

Obaid
  • 75
  • 2
  • 9

1 Answers1

2

I think (class) casting is easier to understand rather than the Class.cast(). When using an IDE for java like eclipse, IDE would prefer generating the (class) casting, that way it is a faster approach in coding.

Alex Sales
  • 176
  • 1
  • 7