: Does cast require additional operations at runtime, or is it just a trick for the compiler ?
:
:
: For example:
:
: Is this
:
:
: MyClass obj = new MyClass(...);
: obj.myField = ... ;
: obj.myMethod(...);
:
:
: faster than this:
:
:
: Object obj = new MyClass(...);
: ((MyClass)obj).myField = ... ;
: ((MyClass)obj).myMethod(...);
:
:
: ?
:
: Thanks for your consideration
:
Hi,
there is definately an overhead for this cast, since java at least has to check whether the cast is all right (ClassCastException).
greetings mo