Looking through some code I came across the following code
trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto));
and I\'d like
Both of these statements are identical. Pick whichever one you find more readable. The second method is more common in my experience, and it is the once that I prefer.
I tend to use the cast method solely when I am working with reflection, and it reads nicer in that situation. All other times I find myself using the second way of casting.