In the code below why foo2 is null when printing its data at system.out.print?  public class Helper {     public void shadowCopy(Foo foo1, Foo foo2){         foo2 = foo1;     }      public static void main(String[] args) {         Helper h = new Helper();         Foo foo1 = new Foo(50);         Foo foo2= null;         h.shadowCopy(foo1, foo2);      System.out.println(foo2.data);// why  java.lang.NullPointerException?     }      public static class Foo {          public int data=0;         public Foo(int data){             this.data = data;         }     }  }
I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?
Is there a way to step between 0 and 1 by 0.1?   I thought I could do it like the following, but it failed:  for i in range(0, 1, 0.1):     print i   Instead, it says that the step argument cannot be zero, which I did not expect. Why doesn't Steam start? When I try to start Steam nothing happens. Reinstall doesn't help.  $ steam Running Steam on ubuntu 13.04 64-bit STEAM_RUNTIME is enabled automatically Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) Installing breakpad exception handler for appid(steam)/version(1378500910_client) unlinked 0 orphaned pipes removing stale semaphore last operated on by process 7278 with name 0eBlobRegistryMutex_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0eBlobRegistrySignal_DC7EBB4AEA41D3C6C74E5EFFD6757CEC removing stale semaphore last operated on by process 7278 with name 0emSteamEngineInstance removing stale semaphore last operated on by process 7278 with name 0eSteamEngineLock Gtk-Message: Failed to load module "overlay-scrollbar" Installing breakpad exception handler for appid(steam)/version(1378500910_client) [0913/182910:WARNING:proxy_service.cc(958)] PAC support disabled because there is no system implementation   How to fix it? Is it possible for reviewers to mistakenly reject a quality paper? Evolution of the Redundancy of the Genetic Code Confused! Are there any differences between "I have to go", "I had to go", "I've had to go", "I get to go", "I got to go", "I've got to go"? I am Confused!   Are there any differences between "I have to go", "I had to go", "I've had to go", "I get to go", "I got to go", "I've got to go"?  In which situation is each term used?  I checked this dictionary , &amp; found that      get to do something:  to have the opportunity to do something   Seem like if you have a opportunity to do something, then use "get".  The expression is in present but why we use present perfect tense (Ex: I've got to go) here? A question about a primitive root mod $p=2^{2^k}+1$, where $p$ is prime. tense and time and composite sentence If the eating meal starts at 7:00 AM and finishes at 8:00 AM. the drinking liquor starts at 7:00 AM and finishes at 7:50 AM.  can I say that :   I drank the liquor when I ate the meal. I ate the meal when I drank the liquor.   Is I need to use progressive tense ? I want to have my super key start dmenu. I have set it as a keyboard shortcut in my rc.xml as follows:  &lt;keybind key="0xffeb"&gt;       &lt;action name="Execute"&gt;         &lt;command&gt;dmenu_run&lt;/command&gt;       &lt;/action&gt; &lt;/keybind&gt;   I tried specifying it in the key attribute as W, W-, and 0xffeb, but none of these worked. W responds to pressing the letter w, and the others appear to do nothing.  I want the shortcut to trigger when the super key is pressed and released on it's own. Is this possible?    This is  from super user as per the . I've read this question: , but I didn't see any useful information in it. I know that the gravitational interaction of antimatter is expected to be the same as normal matter.  But my question is, has it ever been experimentally validated?  I think it would not be a trivial experiment, because electromagnetic effects have to be eliminated, so neutral particles would be needed. Maybe diamagnetically trapped antihidrogen atoms could be examined as to which direction they fall? Modify a shape and have modifications apply to clones Is there any any "Symmetry Modifier" option in illustrator?   Let's say I want to create a head that is totally symmetric. I created one half then mirrored it to get another half. Flipped the other half, aligned them and joined them together with Pathfinder→Unite option.   Now I modified some portion of the right half outline. But how can I get that same modification to be updated on the left option? I thought it would happen automatically. Converting string arrays into Map let's say that I have a following file structure:  ~/DIR1 -fileA -DIR2 --fileB   Then, being in ~, I run this script:  cp DIR1 NEWDIR2   And just an error happens:  cp: omitting directory ‘DIR1’   I understand why nothing from DIR1 gets copied (because I didn't use -r switch that would enforce recursion) but I'd expect the DIR1 folder itself copied to NEWDIR2 (so practically a creation of a new "NEWDIR2" in ~ or a creation of ~/NEWDIR2/DIR1).  Could someone explain to me why is my expectation wrong? checking if a number is a prime I was reading Wikipedia, and it was given that "all primes are of the form 6k ± 1"  (other than 2 and 3), where k = 1,2,3,4,...  Is this statement correct? If yes, can we use this to test if a given number is a prime number? For instance, we can say that 41 is a prime number, since there exists an integer K (K >= 1), such that 6k - 1 = 41 ==> k = 7.  I am confused why this test cannot be used to test if a number is prime?  Thanks, Sekhar Google Mobile Friendly test shows "other error" for resource loads I get the error "Couldn't load 23 page resources" when doing the mobile friendly test at     However, the error message is (the rather unfriendly) "Other error."  When I visit the site in Chrome using Developer Tools and setting the device toolbar to "Responsive," it works fine with no errors, and when I go the Google Search Console and do Crawl->Fetch As Google, I get no errors. Why not use the Lagrangian, instead of the Hamiltonian, in nonrelativistic QM? How can I report bugs with or request features for the Stack Exchange mobile apps? How to get UTF-8 working in Java webapps? Showing a set is nowhere dense in $C([0,1])$ How to evaluate  $$\det\begin{bmatrix}1+x_1y_1&amp;\cdots &amp; 1+x_1y_n\\ \vdots &amp; \ddots &amp; \vdots \\ 1+x_ny_1 &amp; \cdots &amp; 1+x_ny_n\end{bmatrix}$$?  I tried factorisation but I have no idea. I could not factor anything out... I need a hint to kick off.   Edit: A conjecture due to multilinearity: if we let $v_j=(x_1y_j,\cdots,x_ny_j)^T$, then my guess would be $$\det\begin{bmatrix}1+x_1y_1&amp;\cdots &amp; 1+x_1y_n\\ \vdots &amp; \ddots &amp; \vdots \\ 1+x_ny_1 &amp; \cdots &amp; 1+x_ny_n\end{bmatrix}=\det(1,v_2,\cdots,v_n)+\det(v_1,1,\cdots,v_n)+\cdots+\det(v_1,v_2,\cdots,1)=\color{red}{0}$$ where $1$ denote $(1,\cdots,1)^T\in \Bbb K^n$,$\Bbb K$ the underlying number field. Why don't I need to install any Drivers for Ubuntu