How To Put A Int Into An Array In Java Code Example

Snippet 1

  int number = 110101; 
String temp = Integer.toString(number);
int[] numbers = new int[temp.length()];
for (int i = 0; i < temp.length(); i++) {
    numbers[i] = temp.charAt(i) - '0';

Similar Snippets

Create Copy Of Array From Another Array Code Example - java

Creating Java Main Method Code Example - java

Find Duplicates In Arraylist Java Code Example - java

Java Creat A Folder Code Example - java

Firestore Find Doc And Set Data Code Example - java

Copyright © Code Fetcher 2020




Leave a comment

Your email address will not be published. Required fields are marked *