I have a file with values like:   a,9,1  b,2,4  c,2,4  till *,2,0 and this is my code:      public static final String letterFileLoc = "filelocation";     public static Map&lt;Character, Integer&gt; letterValueMap;     public static Map&lt;Character, Integer&gt; letterCountMap;     public static void constructLetterMaps() throws FileNotFoundException{     File pointvals = new File(letterFileLoc);     Scanner pts = new Scanner(pointvals);     while (pts.hasNext()){         String [] parts = pts.next().split(",");         char alpha = (parts[0]).charAt(0);         int counts = Integer.parseInt(parts[1]);         int values = Integer.parseInt(parts[2]);         letterValueMap.put(alpha, values);         letterCountMap.put(alpha, counts);       }   and I keep getting a null pointer expception when I'm putting the values. I don't understand why. Could someone please explain?
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 can an int be cast to an enum in C#? Open maps which are not continuous How do I replace the *first instance* of a string in .NET? Don't show pending suggested edits to me after I run out of votes Now that I've reached 2k on Stack Overflow, I get access to the "Suggested Edits" review queue.  Although I only have 20 edits per day, the "suggested edit awaiting" icon in the top bar is always there and it bothers me a lot!  My suggestion is to apply one of three solutions:   Remove the suggested edits icon when we reach the maximum (50) edits Remove the Highlight (orange) on the suggested edits Remove the suggested edits part when we click on it   What do you think? What is this sand covered insect? I have found in a wooden house, in the mountains of central Spain this very curious insect:    I was wondering if that was its skin or whether it's decomposition or sand or saw-dust.  That particular region of Spain does have stink-bugs ... but this one doesn't look like anything I've seen before.  A google image search returns mostly arachnids ... but it seems to have only 6 legs. Why can't my subclass access a protected variable of its superclass, when it's in a different package? How can I determine how much bleed to use? How do I force TeX to completely use the 1st column? We are developing a C# application for a web-service client. This will run on Windows XP PC's.  One of the fields returned by the web service is a DateTime field. The server returns a field in GMT format i.e. with a "Z" at the end.  However, we found that .NET seems to do some kind of implicit conversion and the time was always 12 hours out.  The following code sample resolves this to some extent in that the 12 hour difference has gone but it makes no allowance for NZ daylight saving.  CultureInfo ci = new CultureInfo("en-NZ"); string date = "Web service date".ToString("R", ci); DateTime convertedDate = DateTime.Parse(date);               As per :     UTC/GMT Offset       Standard time zone: UTC/GMT +12 hours   Daylight saving time: +1 hour   Current time zone offset: UTC/GMT +13 hours     How do we adjust for the extra hour? Can this be done programmatically or is this some kind of setting on the PC's? Can Ubuntu run on a Microsoft Surface with Windows RT? My family might be buying a Windows Surface tablet with Windows RT (Nvidia)? I was wondering if I can run Ubuntu or WUBI on it for my homework? (PHP) Is handling a form submission on the same page more/less/equally good as handling on a separate page? Animating Dynamic Paint with noise texture I'm a trainee teacher and I need to pass a skills test in maths, but I'm having trouble in this particular area of algebra in finding the nth term of any sequence. I've been given a series of questions to answer one of them is:  Find the nth term of the sequence 3, 8, 15, 24.  I not only need to know the answer but more importantly the technique. This is GCSE level. Is there a way to crack the password on an Excel VBA Project? Goal: I want to be able to securely use the internet via my home PC while my notebook is connected to an open hotspot/access point.  I do know that I can use a SSH tunnel/SOCKS proxy, but I don't want to fiddle around with applications (making them use it, if even possible). I guess what I need is an OpenVPN setup, so I'm looking for a detailed guide on how to:   Install and setup the OpenVPN server Setup the OpenVPN client (NetworkManager)   Ubuntu versions this should work on are 10.10 and 11.04. Why was the switch statement designed to need a break? Given a simple switch statement  switch (int) {     case 1 :     {         printf("1\n");         break;     }      case 2 :      {         printf("2\n");     }      case 3 :      {         printf("3\n");     } }   The absence of a break statement in case 2, implies that execution will continue inside the code for case 3. This is not an accident; it was designed that way. Why was this decisions made? What benefit does this provide vs. having an automatic break semantic for the blocks? What was the rationale? When should I use exposure compensation? When should I use exposure compensation, rather than ISO, shutter speed or aperture? What is the best way to iterate over a dictionary? What are the salary and perks of Captain America? Brooklyn is Captain America's home, but times have changed since he was kid 8-9 decades ago. He can't afford a house there, now. This thing really troubled me when he said it in Avengers: Age of Ultron. I mean, I really became sympathetic, despite it being intended for fun.  What's the salary Captain America collects from (fallen) S.H.I.E.L.D. and/or Tony's Avengers organization? Can't they gift him a house in Brooklyn? I mean, he is one of Earth's mightiest heroes who help saved the world lots of times. Locating stolen phone after factory reset I assume any reasonable thief will wipe the phone as soon as possible, thus removing any tracking apps and user accounts.  I there a method to track the phone any way?  A possible method is to use a tracking app (and it's configuration) that's embedded in a custom ROM.