(Solved) : Getting Null Pointer Exception Run Code Q43937862 . . .
![moyol.uva. 1° public class HugeInteger {r public int[] array; public int size; public Huge Integer(String val){ REEBOVOU A WN](https://media.cheggcdn.com/media/828/828db75b-6dc9-4072-85d0-f07c14e9f45a/phpstCYFv.png)
![1. public class Main { public static void main(String args[]) { Huge Integer num = new Huge Integer (1000); //creating new](https://media.cheggcdn.com/media/0ef/0ef0d015-15bb-41dd-966d-f0ce5dfd41e2/phpwSYx94.png)
Why am I getting the null pointer exception when I run mycode
moyol.uva. 1° public class HugeInteger {r public int[] array; public int size; public Huge Integer(String val){ REEBOVOU A WNH int size = val.length(); 7/sets length of string to size int [] array = new int [val.length(); //sets Length of string to length of string for (int i = 0; i < val.length(); i++) { array[i] = Character.getNumericValue(val.charAt(i); //creates array of numbers from string 14 15 } 16 ] 17 18 1. public class Main { public static void main(String args[]) { Huge Integer num = new Huge Integer (“1000”); //creating new object and passing “1000” system.out.print(num.array[@]); //Trying to print element of the num array but keep getting //null pointer exception Show transcribed image text moyol.uva. 1° public class HugeInteger {r public int[] array; public int size; public Huge Integer(String val){ REEBOVOU A WNH int size = val.length(); 7/sets length of string to size int [] array = new int [val.length(); //sets Length of string to length of string for (int i = 0; i
Expert Answer
Answer to Why am I getting the null pointer exception when I run my code…
OR