Can someone execute the code in a simple way?
float[] floats = {...}; // create an array // Now I want to create a new array of ints from the arrays floats int[] ints = ????;
I know that I can just put an element by element into a new array. But is it possible easier?
thank
I am pretty sure that you cannot do this in a different way for your float, for example, than by individually listing each element.
I quickly figured it out, which attracted someone with a similar problem that more or less confirms what I said:
http://www.java-forums.org/advanced-java/11255-type-casting-array.html
. . " ", , .
. , , -, float, getter int.
, , .
Source: https://habr.com/ru/post/1741141/More articles:Duplicate registry entries for deletion when compiling a list of installed software - windowsProving that P <= NP - computer scienceHow does the dataset constructor determine the type of scalar query return? - datasetDetect fake IP address? - phpГрафика/Видение Интересные темы - computer-visionLInq to sql query - linq-to-sqlReceiving message "Expected", "or" {"but found" [selector] "- jqueryHow to create a J2EE EAR file in RAD using Maven? - java-eeHow to match a macro in a list on a chart? - macrosInstall / Upgrade Clickonce Does Not Display Taskbar Icon - .netAll Articles