Login
Login

Re: Covariance

Home 21090308 Forums Re: Covariance

#2017
Ryu
Member

Well, the following code gives you [tt:1nthk3ck]NaN[/tt:1nthk3ck] because you did not insert anything (but only the first element) in the [tt:1nthk3ck]ArrayList[/tt:1nthk3ck]. You need to have a loop to loop thru the whole content in [tt:1nthk3ck][tt]aapl[/tt:1nthk3ck] [/tt], insert them in [tt:1nthk3ck]aaplList[/tt:1nthk3ck] before you convert the list into a [tt:1nthk3ck]double[][/tt:1nthk3ck].

again, stepping thru your code in a debugger will help identify the problem.