I'm new to Java. I'm updating a function that work on files. What I want to do is to move processed files to another folder (to create it if does not exist) If File is c:\abc\efgh\ijkl\xyz.txt the it should be moved to c:\abc\efgh\Backup\xyz.txt   String fileName = &quot;c:\abc\efgh\ijkl\xyz.txt&quot;;   Path f = Paths.get(fileName);   String parentDir = f.getParent().getParent().toString()+&quot;\backup&quot;;    Files.move(Paths.get(filename),     Paths.get(parentDir ));   However, the system crashes error&gt;&gt;Caused by: java.lang.NullPointerException  How do I move the file? I wnat to know how to move the file. it is not about the pointer
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 the airport security at the country you flying from? I highly doubt it because I have been to countries where it's so corrupted that you buy the airport officials for the price of a dinner.   Is it the aircrew' responsibility? Again I don't think they care much - unless there is severe punishments - in corrupted third world countries.   I have been personally in a situation when an officer at a certain airport insisted on examining my British passport before he allowed me to move to the gate because I refused to slip him a $100 note. I was travelling to the UK yet I have another passport which is valid and it is issued by the country I was flying from, which means he had no reason whatsoever - nor I think he cared - to examine my British passport to check if it's valid.  Edit to summarize it, I want to expose as little as possible of information about my dual nationality. For that I need to know whom I am obligated to show my passport(s) Is there a word or phrase for something that one might wish exists, but most certainly doesn't? Why do we need in RSA the modulus to be product of 2 primes? Which part of speech is "Be assured"? Which of the spans in 1.1 is the stronger? Be assured, you are in numerous company if you pick the left one at first glance, where the struts and wires are doing nothing useful at all.   Could you please tell me what is "Be assured" here?  I mean whether it is an adverb, adjective, so on?  And, would you please show me some examples exactly like such the following, considering my original sentence?     Be assured, ... How can i make my Java Swing GUI Components [Right To Left] for Arabic language from NetBeans Desktop Application? Is there a VB.NET-Like operator in C#? How can I calculate how long it will take to transfer a file over LAN? I want to know about the method with which we can calculate data transfer speed.   If I am sending a 1 GB file through a 1 Gb/s LAN connection, from one computer to another, how much time will it take to transfer that file? How to populate options of h:selectOneMenu from database? In the following code I loop through a map and test if an element needs to be erased.  Is it safe to erase the element and keep iterating or do I need to collect the keys in another container and do a second loop to call the erase()?  map&lt;string, SerialdMsg::SerialFunction_t&gt;::iterator pm_it; for (pm_it = port_map.begin(); pm_it != port_map.end(); pm_it++) {     if (pm_it-&gt;second == delete_this_id) {         port_map.erase(pm_it-&gt;first);     } }   UPDATE: Of course, I then  which I didn't think would be related but answers my question. Python BeautifulSoup findAll by "class" attribute Can helium disappear from Earth? I have basic programming skills (I program simple vba python and lisp scripts and had gone through a java course a long time ago), but it seems to me (judging by ESRI publications) that there is no escaping the need to learn .NET for future relevance in the GIS job market (even as an analyst). I've gone through a basic c# course and can program (regrettably) quite poor programs, but I have no idea how to link the c# knowledge to actually programming for ArcGIS in order to progress.  I know the differences aren't big, but does ArcGIS use .NET or C#?  I know the best way to further my experience in .NET is to program more and more but are there any good .NET programming books or courses I can learn techniques from?  In your opinion, what is the best way to learn to program in .NET for ArcGIS? Are there any useful books or websites?   I seek your comments regarding ArcGIS 10 (and will be saving them for later) but also for ArcGIS 9.3.1. I recently started an account on , and went to add an answer to a question which was protected. I have enough rep on other sites that I have the "Association Bonus", so I was confused as to why I wasn't being allowed to answer the question.     This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.   After re-reading the message and reviewing , I realized that the bonus didn't count as points earned toward that site.  This is a really minor issue, but I think it's worth fixing (not sure if bug or feature).  I believe that users who have enough rep to receive the association bonus should generally already know not to post "thanks!" and "me too!" style answers, so if the message is accurate, users who receive the association bonus should be able to answer protected questions.  If there's another reason to keep users from answering protected questions, such as  claim that:     For protected questions, you are expected to have experience on the target site itself. Experience at other sites is not enough.   then the message should be updated to reflect this.  Option 1:  make protected questions open to anyone who has >10 rep on that site and update the message to read:     This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have at least 10 reputation on this site.   Option 2:  leave protected questions the way they are, but update the message to read:     This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site to show that you have experience on this topic; experience on other StackExchange sites is not enough.   Option 3:  Answer with your own suggestions/improvements to these ideas. How to extract the decimal part from a floating point number in C? How can we extract the decimal part of a floating point number and store the decimal part and the integer part into two separate integer variables? There are many times when I curse the autocorrection mechanism for changing what I typed, but overall, much of the corrections are welcome so I don't really want to disable it. I do want to have it do it's work but alert me when it makes each change so I don't have to proofread everything or focus with perfect attention to the screen to see the momentary red and/or blue underlining that alerts me to the machine override.  I would love a way to turn on an audible beep (customizable of course) so that I also get a warning each time my typing gets corrected (and only when autocorrection occurs). Error "Power::infy: Infinite expression 1/0 encountered". Why do I get this? I know, it's been asked before but I couldn't really get a satisfying answer for some details/backgrounds and I guess it's an important question for many.    Some application seem only to be running with Adobe Flash 15 (or at least I know it does, because I have that version on my Windows Partition).  The official Adobe website says:     NOTE: Adobe Flash Player 11.2 will be the last version to target Linux as a supported platform. Adobe will continue to provide security backports to Flash Player 11.2 for Linux.   Some search on the web like "Ubuntu Adobe Flash 15" or similar does not return any good websites.  I found something that says   (using a "pepper-based version"), and  .   Is it impossible to use this for Firefox too? Would it be a privacy risk?  Are there no alternative projects (I know it's closed source but there are so many so very bright people out there using something similar to wine but just for the plugin....)?  How about the Mac-Version? Shouldn't someone be able to port that one to Linux? I have two given names and one surname. Is it a problem if I omit the surname from my ticket? I have two names as my given name in the passport and I typically just use this as my first and last name. However, my passport has a surname too which I almost never use. Due to this, I mistakenly provided my given name as first and last name.   As per the passport,  Surname : AAAA Given name(s) : BBBB CCCC   In the ticket, First name : BBBB Last name : CCCC  The credit card I've used to make this booking has my name as BBBB CCCC.  Will this create a problem at the travel time?  Update : the airline says that they can't update the name in the ticket. They are saying that since they have made a remark of the passport details boarding will not be a problem but I might face problems at immigration. Do they check name details in itenerary to exactly match passport at the time of immigration? Is that true in your experience?  Update : Travelled without any problem, neither at boarding gate, immigration nor after arrival at border police control. When I add a mirror modifier it sometimes doesn't mirror correctly, giving me an overlapping mesh. How can I fix this? Classic Fantasy with characters from the real world I read this book about 6-8 years ago, and it was already slightly old at that point. The key parts were that the characters were all from Earth (America, if I remember correctly - one character internally monologues about remembering exactly how many steps it takes to get to a specific beach from his house, and while I don't remember the beach name, I remember thinking it was American) and woke up in a fantasy world, scattered about, and not remembering where they come from for quite a while.  Each abductee is wearing a bracelet with (what I remember as) polyhedral dice, although they aren't named that I think I inferred it from the description, and at some point they start using them as a form of magic. They find out that they were all abducted by a wizard so they go to find him. I can't remember what happens next, other than that eventually they find him and in a later book in the series (that I only saw the blurb of) they go back to his castle.  I think the book might be called "______ Keep", and am fairly certain the later book in the series is called "Return to ______ Keep".  I'd really appreciate it if someone who knew the title could tell me - it's like an unscratched itch at the moment, and I'd love to read it again!