Link to home
Start Free TrialLog in
Avatar of sudhakar_koundinya
sudhakar_koundinya

asked on

Efficiency of typecasting

Hi All,

I just get the doubt. Could you please clarify that

java.util.List contains either strings or my own defined class instances

now when I try to type cast them to Array, will it reduce the efficiency of method??


I  am type casting like this. List's size may vary from 1 to 100000

(String[])list.toArray(new String[0]);  

        or

(IWdHttpRefernce[])list.toArray(new IWdHttpRefernce[0]);  

SOLUTION
Avatar of DrWarezz
DrWarezz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of expertmb
expertmb

>>will it reduce the efficiency of method??
it should not, you are now making different kind of reference to the object.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial