I am extremely new with java. I have been working on a project and am completely stumped.  What I am trying to do is I need to build a application that generates an ArrayList of certain students and grades, and then i will be able to manipulate them from there.   I thought I had it down to where I could get it to create the object at the very least, but it looks like that is not the case. It compiles correctly, but when I try to create the object using the Student() constructor with no arguments it gives me the following stack trace:  java.lang.NullPointerException     at Student.addInitialStudents(Student.java:61)     at Student.&lt;init&gt;(Student.java:23)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     at java.lang.reflect.Constructor.newInstance(Constructor.java:423)     at bluej.runtime.ExecServer$3.run(ExecServer.java:759)   from reading the stack trace it looks like the issue is in my constructor.  import java.util.ArrayList;  public class Student {      public ArrayList&lt;Student&gt; students = new ArrayList&lt;Student&gt;();     private String studentID;     private String firstName;     private String lastName;     private String email;     private int age;     private int grade1;     private int grade2;     private int grade3;     private int[][] grades;     private int i;     private int x;      /**      * Constructor for objects of class Student      */     public Student(){         addInitialStudents();     }      public Student(String studentID, String firstName, String lastName, String email, int age, int[][] grades)     {         this.studentID = studentID;         this.firstName = firstName;         this.lastName = lastName;         this.email = email;         this.age = age;         this.grades = grades;     }      private void addInitialStudents(){         String[] id = {"1","2","3","4","5"};         String[] fName = {"John", "Suzan", "Jack", "Erin", "Sam"};         String[] lName = {"Smith", "Erickson", "Napoli", "Black", "smith"};         String[] mail = {"John1989@gmail.com","Erickson_1990@gmailcom","The_lawyer99yahoo.com","Erin.black@comcast.net","ssmith@gmail.com"};         int[] listAge = {20, 19, 19 ,22, 28};         int[][] iniGrades =         {             {88, 79, 59},             {91, 72, 85},             {85, 84, 87},             {91, 98, 82},             {99, 87, 92}         };          for (i = 0; i &lt;= 4; i++){              studentID = id[i];             firstName = fName[i];             lastName = lName[i];             email = mail[i];             age = listAge[i];              for (x = 0; x &lt;= 2; x++){                 grades[i][x] = iniGrades[i][x];             }               students.add(new Student(studentID, firstName, lastName, email, age, grades));          }      }      public void getID(){         System.out.print(students.get(0));     }  }   Anyone have any tips on this?   BlueJ is highlighting the line   grades[i][x] = iniGrades[i][x];   I'm sorry if this is a duplicate, but I couldn't find a solution no matter how much research i tried to do and no matter how many changes I make.
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 there a way to include an entire text file as a string in a C program at compile-time?  something like:   file.txt:  This is a little text file  main.c:  #include &lt;stdio.h&gt; int main(void) {    #blackmagicinclude("file.txt", content)    /*    equiv: char[] content = "This is\na little\ntext file";    */    printf("%s", content); }    obtaining a little program that prints on stdout "This is a little text file"  At the moment I used an hackish python script, but it's butt-ugly and limited to only one variable name, can you tell me another way to do it? Which is correct: "the below information" or "the information below"? Show that $R/I\otimes_R R/J\cong R/(I+J)$ I've got a very large document (which I've broken into "chapters" and such) which I've recently moved a few things around in.  Is there a nice way to get latex to output a list of forward references? (like, things in chapter 5 that reference a result in chapter 10) Adjective for someone who exaggerates emotions to get sympathy What's the word for someone who tries to get sympathy from others by exaggerating their emotions or constantly reminding them of something tragic that happened to them?  I'm looking for an adjective - no disorders or health related definitions please. The Frobenius Coin Problem I am asked to prove that:       For integers $n, x,y &gt; 0$, where $x,y$ are relatively prime,        every $n \ge (x-1) (y-1)$ can be expressed as $xa + yb$, with nonnegative integers $a,b \ge0$.   How should I approach this? I have very limited knowledge in number theory. Make a div fill the height of the remaining screen space Do the SSH or FTP protocols tell the server to which domain I am trying to connect? When using the ssh or ftp commands from the Bash shell, does the server that I am connecting to learn of the domain name used? I understand that the domain name is locally translated into an IP address via DNS. In HTTP, after that happens, the server is told the original domain name as well in order to serve the correct page, or to present the correct TLS cert (SNI).  host serverfault.com GET /   Does a similar phenomenon happen when connecting to ssh or ftp?  I ask because I am  trying to ssh into a server (GoDaddy webhosting) which expects a domain name, but is not letting me in when I try to connect via user@IPaddress as the DNS is not yet moved to the GoDaddy IP address. I'm attempting to do this in a procedure:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         SELECT ... INTO #bTemp FROM #aTemp;     END END   I get the error:  Msg 2714, Level 16, State 1, Line 10 There is already an object named '#bTemp' in the database.   Why is this happening and is there a work around?  Update  I've attempted to add a DROP statement as suggested , but it still does not work:  DECLARE @a bit = 1; BEGIN     SELECT * INTO #aTemp FROM OPENROWSET( ... );      IF @a = 0     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END     ELSE     BEGIN         IF OBJECT_ID('[tempdb]..#bTemp') IS NOT NULL         BEGIN             DROP TABLE #bTemp;         END          SELECT ... INTO #bTemp FROM #aTemp;     END END CentOS 7 DVD ISO vs Everything ISO different Why queuable apex accepts sobjects where as future methods doesn't? I was going through asynchronous apex and reading it made me confused at one point. In future methods, we cannot pass sojects for reasons future methods being executed at a later point of time, by the time it is executed the sboject data could be stale. But, at the same time, the more advanced queuable apex accepts sobjects. Why is it so? The same reason is applicable for queuable apex also right? kindly clarify. Floating point comparison How quickly is antibiotic resistance lost? How does a graduate program's admissions committee operate? How does a typical graduate program's admissions committee operate? (In the US --- I understand that in Europe admissions are often structured differently.)  My mental model at the moment is several professors sitting in a conference room with a stack of printed applications and a few piles: accept, maybe, and reject. Three or so professors will read an application and then make a decision. If the volume of applications is large enough, multiple meetings might be required. This is purely my imagination --- I don't know how accurate this model is.  Of course, I'm sure that how admissions are handled depends greatly on the school, program, and department. I'm interested in a few data points to get a rough idea of what the average is.  A few more specific related questions:   How much time does a typical committee spend on each application? I suspect there's a distribution. Obviously unqualified applicants will probably have their applications tossed into the reject pile pretty quickly. Qualified applicants' applications might receive more attention. Do admissions committees look online for more information about an applicant? I've read some professors (in CS --- not my field) will look at a student's research/project website, but I have no idea how common this is. How to tell Max CP? I'm comparing different pokemon of the same type (e.g. comparing pidgeys with each other), to see which ones I want to keep and which to transfer. I want to select based on Max CP -which differs per each pokemon-, but it's a bitch to find what a pokémon's max CP would be.  Even though the bar fill isn't very accurate (not determined per every 1%), if a CP bar is filled to 50%, it's not hard to find out what the max CP of that pokemon is. But otherwise, since there are no round measurement tools in any software I know of, it stays at mere guessing.  Does anyone know of a way to do this effectively? "[" as first character in table row Whenever I try to compile a table that has a "[" as first character in a row it gives me the error:  Missing number, treated as zero. Illegal unit of measure   Example:  \begin{table}[htb]     \centering     \begin{tabular}{r|r}         [some text ] &amp; ... \\         [some more text ] &amp; ...     \end{tabular}     \caption{...}     \label{tab:...} \end{table}   How can I print "[" as first character in a row? In a bash script what does a dot followed by a space and then a path mean? I came across this example when trying to mount a usb device inside a openvz container and I have never seen the construct in the second line before. Can you explain what it signifies?  #!/bin/bash . /etc/vz/vz.conf I have a failure to transfer my game from one HDD to another, and one PC to another. I copied the entire Skyrim folder from one HDD to another. And told where to find it also. Steam did a huge check of my HDD.  But it ended up downloading most of the files anyway. It took a week to download Dawnguard, Hearthfire, and Dragonborn files along with my Hi-Res textures.  I did ask about it in chat. But I feel this could help me or somebody else.  This is the screen I am looking at after transferring my entire hard drive to to new one. Steam downloaded my games, including Skyrim even though my Skyrim data folder had all the data files for Dawnguard, Hearthfire, Hi-Res and Dragonborn.  I have my copied files and have got rid of everything not steam related. I just have my DLCs and they include my hires files.  This is what it looks like.    But I still get this :     What could be causing this? How can I rectify? And in future when one is migrating to a new PC, how can this be avoided?  EDIT::::::::::::::::: Removed everything : Here is how it looks :  Still the prompt as before Steam Error 15  (Side Note : I transferred all my Origin games just by copy/pasting. This really is not nice.)    EDIT 2 :::::::::::::::::::::  And one more EDIT  I tried getting game cache up to speed, but this is prompt I am getting. But I played the game, it was working, I could pick out my character and all, and escape from Helgen.  EDITED 3 :::::::::::::::::  How does one transfer a Steam game? A game that is heavily modded, will the backup a Steam Game option suffice? FileReader.js nothing happens in IE9 Can a willing lycanthrope be True Polymorphed? Can a lycanthrope or other shapeshifter be willingly affected by the spell True Polymorph? I know that it can be affected by regular Polymorph, but the text for the enhanced version seems to differ.