java - Receiving a null pointer exception -


I have a class that sets an array. Another class enhances this square and uses the array described in a method to return any other array. When I do this I get an exception, but when I set the basic array, it works fine. Not sure what I'm doing wrong here

  Public Class Initial Grid {int iic, ioc, iman;  

Int NIC, NOC; Double mascic, masc, masman; Double Wallcom, Volok, Wallen, Wolpee; Double Radical, Radoc, RDP; Public IIMT []; Public Double Rod []; Public double volume []; Public Double Month []; Public Double Dema []; Public double [] radius (int nr) {rad = new double [nr +1]; For (int k = 0; k & lt; = nic; k ++) {rad [k] = radic * ((double) k / nic); System.out.println ("Radius in Shell" + K + "is" + Rad [k]); } For {int k = nic + 1; k & lt; = noc; k ++} {rad [k] = radic + (radoc - radic) * ((double - n - nic) / (noc - Nic))); System.out.println ("Radius in Shell" + K + "is" + Rad [k]); } For {int k = noc + 1; k & lt; = nr; k ++} {rad [k] = radoc + ((radP - radOC) * ((double - noc) / (nr - Noc))); System.out.println ("Radius in Shell" + K + "is" + Rad [k]); } Return (rod); }

This is the class that extends the initial grid:

  Initial grid in public category compression (double g; double pi; double Expanded; Double X, Z, D, DJ, DDX; // This will be the dynamics that will update the dual double delta; Double mixtures; Public Double Grave []; Public Double P []; Public Double Ron []; Public Double Radan []; Public Double [] Gravity (int nr) {G = Constants.PI; PI = Fixed; PI; Grav = New double [NR + 1]; for (int k = 1; k & lt; = nr; k ++) {grav [0] = 0; grave [k] = ((g * m [k]) / (MathPo [Red], 2)));} Return (gravity);}  

I'm calling them in the main category:

  Initial grid ig = new initial grid (); Ig.setup (icMat, ocMat, manMat, nr, masP, fic, foc, fman, fsi, fsi, fo); ig.material (nr); ig Radius (NR); Ig.density (NR, FSI, FSI, Focus); ig.volume (NR); ig.dmass (NR); ig.mass (NR) ; Compression com = new compression (); com.gravity (NR); Com.pressure (nr); Com.newDensity (NR); Com.radn (nr);  

"mas []" has not been initiated anywhere in your code until you It is not starting elsewhere, this is your problem.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -