Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java convert array to another type

import java.util.Arrays;

int[] arr = {1, 2, 3, 4};

// convertions
Object[] a = Arrays.stream(arr).mapToObj(i -> i).toArray();
Double[] b = Arrays.stream(arr).mapToDouble(i -> i).toArray();
Long[] c = Arrays.stream(arr).mapToLong(i -> i).toArray();
Comment

PREVIOUS NEXT
Code Example
Java :: hippo remove property 
Java :: lombok get error in extended classes¨ 
Java :: system vs integration testing 
Java :: java loop through string 
Java :: processing load font from file 
Java :: java string lowercase 
Java :: null character in java 
Java :: HOW TO SUPRESS sonar warning in java code 
Java :: hellow world java code 
Java :: android display drawable in imageview 
Java :: rates api 
Java :: How to find the Levenshtein distance between two strings of characters using dynamic programming, in Java? 
Java :: big integer input in java 
Java :: java array copy 
Java :: add text to jlable 
Java :: java int to binary string 
Java :: java string multiply 
Java :: RealmConfiguration.Builder.allowWritesOnUiThread(true) 
Java :: check if string is null or empty java 
Java :: java read string input 
Java :: gradle require java version 
Java :: java pre increment 
Java :: java jdk java_home home ubuntu openjdk-8-jdk 
Java :: javafx textarea font size 
Java :: java convert list to page 
Java :: bukkit scheduled task 
Java :: spring security enable global cors 
Java :: switch activity android studi 
Java :: fibonacci in java 
Java :: how to calculate the amount of months between two dates java 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =