import java.util.*;  class Person {     protected String firstName;     protected String lastName;     protected int idNumber;      // Constructor     Person(String firstName, String lastName, int identification){         this.firstName = firstName;         this.lastName = lastName;         this.idNumber = identification;     }      // Print person data     public void printPerson(){          System.out.println(                 "Name: " + lastName + ", " + firstName              +   "\nID: " + idNumber);      }  }  class Student extends Person{     private int[] testScores;      /*   Class Constructor     */     Student(String fName, String lName, int id, int[] scores){         super(fName, lName, id);         for(int i = 0; i &lt; scores.length; i++){             testScores[i] = scores[i];         }     }      public char calculate(){         int total = 0;         for(int i = 0; i &lt; testScores.length; i++){             total = total + testScores[i];         }         int grade = total/testScores.length;         char mark = 'q';         if(grade &lt;= 100 &amp;&amp; grade &gt;=90){             mark = 'O';         }         else if(grade &lt; 90 &amp;&amp; grade &gt;= 80){             mark = 'E';         }         else if(grade &lt; 80 &amp;&amp; grade &gt;= 70){             mark = 'A';         }         else if(grade &lt; 70 &amp;&amp; grade &gt;= 55){             mark = 'P';         }         else if(grade &lt; 55 &amp;&amp; grade &gt;= 40){             mark = 'D';         }         else if(grade &lt; 40){             mark = 'T';         }         return mark;     }   }  class Solution {     public static void main(String[] args) {         Scanner scan = new Scanner(System.in);         String firstName = scan.next();         String lastName = scan.next();         int id = scan.nextInt();         int numScores = scan.nextInt();         int[] testScores = new int[numScores];         for(int i = 0; i &lt; numScores; i++){             testScores[i] = scan.nextInt();         }         scan.close();          Student s = new Student(firstName, lastName, id, testScores);         s.printPerson();         System.out.println("Grade: " + s.calculate());     } }   I'm practicing Java class inheritance and I came across a problem running the above code. I made a person class with methods and instance variables and a student class that extends the person class with an additional instance variable of an array that holds the marks. Also, there is a method that calculates the mark based on the average. When I try to print all the info of the student it gives an error. I think the problem is the constructor of the subclass I'm not sure. Can you guys help me?
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?
How do I get the UI thread's Dispatcher? How can I assign a Func conditionally between lambdas using the conditional ternary operator? Please help me with a tabular problem Proof of Strong principle of Induction (T. Tao Analysis I) I am not asking about the two factor authentication process where the user needs to enter both a password and a one-time-password.  Gmail recently (I don't know from when exactly) changed their login process which is depicted in the following screenshot:     So, the new steps are as follows:   Enter email   Click Next  Enter password   Click Sign In    as opposed to the previous and usual way of logging in:   Enter email and password   Click Sign In    Isn't the new process non-user friendly requiring extra user interactions?  Since, Google does not usually make UX blunders can you explain the reasoning behind the new process? I'm looking for details like user interaction simplicity or any other hidden advantages.  Note: The question  doesn't cover the reason behind the change while Mervin Johnsingh's answer cites Google's reason. How can I remove the site URL from enqueued scripts and styles? I'm dealing with an SSL issue and I would like to strip the domain from all scripts and styles being output via wp_enqueue_scripts. This would result in all scripts and styles being displayed with a relative path from the domain root.  I imagine there is a hook that I can use to fileter this, however, I am not sure which one, nor how to go about it. Limit distribution of infinite sum of Bernoulli random variables Is there a way to save composite node presets? Is there any way in Blender to save settings in your compositing node setup. For example say for my shadow catcher I have it setup for a hard shadow for sunlight, and then I also have a setting for diffuse light shadow for indoors. Is there any way I can save these settings individually so I can quickly switch to them rather than having to individually change the nodes every time. There should be infinitely many primes of the form $5+6n$. How do you prove it? The same should be true for $7+6n$. In this case what is correct?        Keep Tom and I updated.      or         Keep Tom and me updated.      I understand that me is an object pronoun. And therefore I feel the second option is correct.  Especially, because I would say "Keep him updated" and also "Keep me updated". Instead of "Keep he updated" or "Keep I updated". But something about saying "Keep him and me updated" feels wrong.  However I am not sure, because several people have told me that in this case I is the correct option because it is being used in conjunction with a name (Tom) and not a pronoun. Is that correct? Why every map $f : S^n \to T^n (n>1)$ has topological degree zero? Why every map $f : S^n \to T^n (n&gt;1)$ has topological degree zero?  I don't know anything about covering spaces, and has been told to me that this assertion comes from this theory!  I do appreciate any help. Does 10 heads in a row increase the chance of the next toss being a tail? I assume the following is true: assuming a fair coin, getting 10 heads in a row whilst tossing a coin does not increase the chance of the next coin toss being a tail, no matter what amount of probability and/or statistical jargon is tossed around (excuse the puns).   Assuming that is the case, my question is this: how the hell do I convince someone that is the case?   They are smart and educated but seem determined not to consider that I might be in the right on this (argument). In QGIS (1.8.0-Lisboa) on Windows (OSGeo4W Install), how would you resize a feature proportionally?  The only way I've found to do this is by hand using either the Freehand Editing (0.2.6) plugin or the Reshape Features button. Neither of these provides a means to uniformly scale (as in resize) the selected feature up or down.  For example, I want to increase the features size by 130% so that you retain the shape of the feature but expand the area of the shape itself proportionally in all directions. Can't open snap-store Javascript close alert box I want to be able to close an alert box automatically using Javascript after a certain amount of time or on a specific event (i.e. onkeypress).  From my research, it doesn't look like that's possible with the built-in alert() function.  Is there a way to override it and have control over the dialog box that it opens?  Also, I don't want an override that shows a hidden div as the alert.  I need an actual dialog box. locale not found/setting locale failed - what should I do? I've installed Debian 7 i386 on my VPS (OpenVZ). Everything works fine, except locales - any attempt to install anything shows:  [...] perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:     LANGUAGE = (unset),     LC_ALL = (unset),     LANG = "pl_PL.UTF-8"     are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory [...]   What I've tried:   Generating locales myself - update-locale LC_ALL="pl_PL.UTF-8" - shows:  apt-get install --reinstall locales  The same with dpkg-reconfigure locales + setting pl_PL.UTF-8, pl_PL.ISO-8859-2 or even en_US:  export LC_ALL=pl_PL.UTF-8 (even on root):  -bash: warning: setlocale: LC_ALL: cannot change locale (pl_PL.UTF-8)    Here is what shows locale:  root:~# locale locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory LANG=pl_PL.UTF-8 LANGUAGE= LC_CTYPE="pl_PL.UTF-8" LC_NUMERIC="pl_PL.UTF-8" LC_TIME="pl_PL.UTF-8" LC_COLLATE="pl_PL.UTF-8" LC_MONETARY="pl_PL.UTF-8" LC_MESSAGES="pl_PL.UTF-8" LC_PAPER="pl_PL.UTF-8" LC_NAME="pl_PL.UTF-8" LC_ADDRESS="pl_PL.UTF-8" LC_TELEPHONE="pl_PL.UTF-8" LC_MEASUREMENT="pl_PL.UTF-8" LC_IDENTIFICATION="pl_PL.UTF-8" LC_ALL=   Nothing interesting found in /var/log. Even changing repo to official + purge and manual installation locales doesn't solve my problem, which manifests itself on each fresh installation of Debian 7. Prove: If $A$ is a finite set and $B$ is an infinite set, then $B \setminus A$ is an infinite set.   I've tried proving the contrapositive, that if $B \setminus A$ is a finite set then $A$ is infinite or $B$ is finite, but I don't think this is the way to go. Is "princessship" a real word? Are there any other words which have the same letter 3 times consecutively? Solution check: Let $f_n$ be fibonacci numbers. Prove: $\sum_{k=0}^{n-1} \binom{n+k}{2k+1} = f_{2n-1}$ and $\sum_{k=0}^n \binom{n+k}{2k} = f_{2n}$ How to get rid of notch at pgfplots axes intersection?