Advertisement
Vankata17

nextNumberOfArray

Feb 6th, 2021
791
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1. package Second.Semester;
  2.  
  3. public class nextNumOfArray {
  4.     public static void main(String[] args) {
  5.         int[] array1 = {9,9,8};
  6.         String combined = "";
  7.         for (int i = 0; i < array1.length; i++) {
  8.             combined += Integer.toString(array1[i]);
  9.         }
  10.         int parsedNumber = Integer.parseInt(combined);
  11.         System.out.println(parsedNumber+1);
  12.     }
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement