This is my code to parse a string which comes in the format of #some headers#val1,val2,val3,val4,val5#. So, i tried to parse the vals out of the format. I'm getting NullPointerException on the last line of the submitted code. Anyone kindly help to resolve this issue  String stringVal = "formatted text as mentioned above";  System.out.println("In string parser"); String delimit = "#"; int limit = 4; output = stringVal.split(delimit, limit); System.out.println("after split : "+ output[2]);  DataVals = output[2].split(",", 6); System.out.println("DataVals :"+Arrays.toString(DataVals)); nCtrlNo[j] = DataVals[0];   //-----&gt; error occurs on this line   Class members DataVals &amp; nCtrlNo defined as  static String[] DataVals; static String[]  nCtrlNo;
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Is it ok to say "good morning" at anytime? Why do all the planets of the solar system orbit in roughly the same 2D plane? Most images you see of the solar system are 2D and all planets orbit in the same plane. In a 3D view, are really all planets orbiting in similar planes? Is there a reason for this? I'd expect that the orbits distributed all around the sun, in 3D. Has an object made by man (a probe) ever left the Solar System? What does the factorial of a negative number signify? I understand that the factorial gives the number of arrangements. For example: the factorial of zero i.e. an empty set ( doesn't occur) is 1.   As the empty set can be arranged only in 1 way - i.e. by filling nothing. Now, let's take an example: 5 distinct seats. How many ways 5 distinct seats can be arranged? - 5! ways i.e. 120.  So, basically, factorial gives us the arrangements. Now, the question is why do we need to know the factorial of a negative number?, let's say -5. How can we imagine that there are -5 seats, and we need to arrange it? Something, which doesn't exist shouldn't have an arrangement right? Can someone please throw some light on it?. I saw some research done on the formula - "Elder brother" or "older brother"? I've read both forms in newspapers and online news: elder brother and older brother. What's the difference between them? When should I use which? Kind of converse of Kolmogorov maximal inequality Let $S_n=\zeta_1+...+\zeta_n$ where $\zeta_i$ are independent with $E\zeta_i=0, E\zeta_i^2=\sigma_i^2&lt;\infty, |\zeta_i|&lt;K$.  Then, $P(\max_{1 \leq m  \leq n}|S_m| \leq x) \leq (x+K)^2/\operatorname{var}(S_n)$.  How do we show this?  The hint says that I should use the fact that $S_n^2-\sum_{m \leq n}\sigma_m^2$ is a martingale. But I am totally clueless....  Any hint would be appreciated! Thanks and regards. What are the uses of "using" in C#? I've lost my original power adapter, and I can't find the proper one in any of the stores currently available.  I've HP Compaq 6730b, and as per  it outputs 18.5V 3.5A. However, I've found an older power adapter I have which outputs 19.5V 4.62 A.  So, my question is: how much of a difference between those two it really is, and more importantly, how much of a risk would it be if I tried the power adapter I already have.  P.S. I know pretty much nothing about electricity/electronics. How to set system-wide environment variables on OS X Mavericks I'm trying to use ARIMA process to predict the behaviour of a time series, the probleme I face is that I can't get the order of each component of ARIMA, the lag is between 0 and 1, same goes for the acf. The time series has no tendency, and I guess no seasonality.     My question is : Does this mean that ARIMA orders are all 0s, and if so, is the HoltWinters a good (or the best) solution for modelling this kind of TS ? I've just had to write a string reverse function in C# 2.0 (i.e. LINQ not available) and came up with this:  public string Reverse(string text) {     char[] cArray = text.ToCharArray();     string reverse = String.Empty;     for (int i = cArray.Length - 1; i &gt; -1; i--)     {         reverse += cArray[i];     }     return reverse; }   Personally I'm not crazy about the function and am convinced that there's a better way to do it. Is there? Math Induction Proof: $(1+\frac1n)^n < n$ Preposition 'to' with gerund (-ing)? Check this sentence from  (US Department of Education)     Technology ushers in fundamental structural changes that can be integral to achieving significant improvements in productivity.   Cannot it be better as...     Technology ushers in fundamental structural changes that can be integral to achieve significant improvements in productivity.   The preposition to takes gerund (-ing) here. Any rule? Python mechanize javascript Careers Stack Overflow - Tag "ruby-on-rails" returns jobs that don't contain the tag "is" operator behaves unexpectedly with integers Why does the following behave unexpectedly in Python?  &gt;&gt;&gt; a = 256 &gt;&gt;&gt; b = 256 &gt;&gt;&gt; a is b True           # This is an expected result &gt;&gt;&gt; a = 257 &gt;&gt;&gt; b = 257 &gt;&gt;&gt; a is b False          # What happened here? Why is this False? &gt;&gt;&gt; 257 is 257 True           # Yet the literal numbers compare properly   I am using Python 2.5.2. Trying some different versions of Python, it appears that Python 2.3.3 shows the above behaviour between 99 and 100.  Based on the above, I can hypothesize that Python is internally implemented such that "small" integers are stored in a different way than larger integers and the is operator can tell the difference. Why the leaky abstraction? What is a better way of comparing two arbitrary objects to see whether they are the same when I don't know in advance whether they are numbers or not? Stack Exchange & Area 51 sign up/ log in update Does one wing of fly contain harmful microbes and the other contain only antibodies? There was  study but the conclusion and it's source's relability seemed a bit off. How come a house flies one wing contain all microbe and the other don't. I did setup an easy scene with an area light behind a window. In the glass (simple plane) which is in front the area light is visible - how can I turn this off so that the background is shining throgh? I know that a continuous function which is a BV may not be absolutely continuous.  Is there an example of such a function?   I was looking for a BV whose derivative is not Lebesgue integrable but I couldn't find one. How to prove the divisibility rule for $3\, $ [casting out threes] The divisibility rule for $3$ is well-known: if you add up the digits of $n$ and the sum is divisible by $3$, then $n$ is divisible by three.  This is quite helpful for determining if really large numbers are multiples of three, because we can recursively apply this rule:  $$1212582439 \rightarrow 37 \rightarrow 10\rightarrow 1 \implies 3\not\mid 1212582439$$ $$124524 \rightarrow 18 \rightarrow 9 \implies 3\mid 124524$$  This works for as many numbers as I've tried.  However, I'm not sure how this may be proven.  Thus, my question is:     Given a positive integer $n$ and that $3\mid\text{(the sum of the digits of $n$)}$, how may we prove that $3\mid n$?