My variable is unused and I don't understand why? I am working on an assignment and it would be unfair if I post the question up here, so I will just post the problem I have that I can't find the solution to it.   I have created these two methods:  public static void checkValue(String x, int y){     String p1 = "p1";     String p2 = "p2";     String p3 = "p3";     String p4 = "p4";     String p5 = "p5";     String p6 = "p6";     String p7 = "p7";     String p8 = "p8";     String p9 = "p9";     String p10 = "p10";     if(p1.equals(x)){         y = 1;     }     else if(p2.equals(x)){         y=2;     }     else if(p3.equals(x)){         y=3;     }     else if(p4.equals(x)){         y=4;     }     else if(p5.equals(x)){         y=5;     }     else if(p6.equals(x)){         y=6;     }     else if(p7.equals(x)){         y=7;     }     else if(p8.equals(x)){         y=8;     }     else if(p9.equals(x)){         y=9;     }     else if(p10.equals(x)){         y=10;     } }   the Second one:  public static void transferValue(String[] x, int[] y){     for(int i=0; i &lt; x.length; i++){         checkValue(x[i],y[i]);         System.out.print("x: " + x[i]);         System.out.print(" y: " + y[i]);         System.out.println();     } }   When I tried to use them in the main method like this:  public static void main(String[] args) throws Exception{      graph Graph = new graph(maxNode);      String [] x = new String [] {"p1", "p2", "p3"};     int [] y = new int[3];      Graph.transferValue(x,y);     }   The results they printed out are:   x: p1 y: 0 x: p2 y: 0 x: p3 y: 0   Which are very different of what I have in mind:  x: p1 y: 1 x: p2 y: 2     x: p3 y: 3   I would appreciate if you guys can help me with a solution for this problem since I can't solve it.   Thank you,  Vinh
Is Java "pass-by-reference" or "pass-by-value"? 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?
Alternative to Adobe Illustrator Can you recommend a good alternative to Adobe Illustrator?   I am learning vector based graphic design, but I am not ready to make such a large investment as to purchase a copy of Adobe Illustrator. Also, Illustrator might be a little more power than I need at the moment. I am using a Macintosh. How to view the system console message after Blender crashes? I am testing a script in Blender game engine. I can view the helpful message on the external system console when the script throws exception. Sometimes the bugs of the script cause the Blender to crash and close the console immediately.    Is there any way to view the message after the Blender crashes? How to write the message to a text file for later viewing? Any suggestion? Where to insert the exclamation mark Where would I insert an exclamation mark and a comma in the below sentence?     "Look at that boy" he exclaimed. In The Witness, I was walking along the coast, and I came upon this:    Now, since I've learned      that mazes can be embedded in the environment,   I see the puzzle here, but I just can't get the pieces to line up well enough.  Standing on the couch and walking all around it doesn't seem to get me a       functional maze.   Where do I need to stand to activate the puzzle successfully? Is it possible to generate electric energy from the radiation of radioactive materials I wonder if it is possible to generate electric energy from the radiation of radioactive materials like nuclear waste? If it is then wouldn't that also mean that it could be used as an energy source for a very long time since the radiation takes a long time to decay? I got stuck on this inequality for a day. If $p$ is positive integer, then the problem becomes too easy, but I can't find how we deal with the general case when p can be any positive number. Can someone give me a hint? I really appreciate     Prove that $|x^p - y^p| \le p|x-y|(x^{p-1} + y^{p-1})$ provided that $1 \le p \lt \infty$ and $x, y \ge 0$ Using TP4056 module to charge battery while load remains connected Cross Browser Flash Detection in Javascript Does anyone have an example of script that can work reliably well across IE/Firefox to detect if the browser is capable of displaying embedded flash content. I say reliably because I know its not possible 100% of the time. Gravitational potential at a point in a gravitational field is defined as work done per unit mass in bringing a small test mass from infinity to the point.  I know that:   By integration, we find that gravitation potential is negative. The maximum value of gravitational potential which is at infinity distance is 0, therefore minimum value should be negative.   But, what I do not understand is force is in the same direction as displacement so why work done is not positive? Transfer from JFK Terminal 2 to Terminal 4 I have family who does not speak English.  They are changing planes in JFK Airport and will most likely be transferring from Terminal 2 (Delta) to Terminal 4 (China Southern Airlines).  At first I thought that directing them to use the Airtrain would be best.  However, in doing more reading my understanding is that the Airtrain would mean they would need to go through security again.  I found this on Delta's site:   If they use the JITNEY Shuttle to change from Terminal 2 to Terminal 4, does that mean they would not need to re-clear Security?  Edit: They are flying TO China. They are going from Tampa -> NY JFK -> China. Where to start looking up if there's something wrong with cck field variables? in short: Something in my zen-based custom theme is keeping a couple of cck fields from being display on my page. Basically my question is where to get access to the variables that are supposed to contain the html for the cck fields (which are missing when I was looking them in firebug). Below I explain why I think it's looking up the variables that might bring me closer to a solution  So I made this custom node type (events) with cck fields added. Also made some content using those fields. Added some css and it all displayed fine. Later the taxonomy terms below the title and some metadata bugged me so I followed along with a 'theming cookbook' pdf book that taught me how to make a node-events.tpl.php and simply deleted php variables like $terms. This worked great.     Obviously this also means that all this time, the view permissions of those fields have been checked and also that the display options under 'display fields' have been set to standard all the time. I also ruled out that the issue could be anything else than theme related as my cck fields do show up in a stock Drupal theme. The theme for my site is a zen-based custom theme.   So then even later, after I made a view for this node type and started adding css to that view I noticed at some point that my image field and two other fields are missing. It's hard to tell if they disappeared because of things that I did when creating the view and adding css (which would surprise me) Pretty tricky cmd Did Emperor Palpatine know about Luke and Leia from the beginning? Did Emperor Palpatine know that Padme had given birth to twins while it was happening?  Was it his long-term goal to have Vader only discover his offspring later, at some "correct" moment? Bird flying in a cage Assume that you are holding a cage containing a bird.  Do you have to make less effort if the bird flies from its position in the cage and manages to stay in the middle without touching the walls of the cage? Does it make a difference whether the cage is completely closed or it has rods to let air pass? Ctrl+Alt+← can usually be set to restart X, however I can't find the option to allow this (it is disabled by default).  I have looked in System-&gt;Preferences-&gt;Keyboard and System-&gt;Preferences-&gt;Keyboard Shortcuts but I can't find an option to enable it.  Where can I change this setting? Bread and butter is/are my breakfast? Bread and butter (is or are) my breakfast?  And what's the difference between the above sentence and saying "My breakfast is bread and butter"?  Thanks. Change Text Color in Blender Game Engine? I want to change the color of some text in my game. I've tried adding materials, but whenever I press P to play the game, the text stays the same white color. Any ideas? how to prove $437\,$ divides $18!+1$? (NBHM 2012) I was solving some problems and I came across this problem. I didn't understand how to approach this problem. Can we solve this with out actually calculating $18!\,\,?$ Can a single PS Plus subscription be used on two different profiles on the same PS4? Both my girlfriend and I play on the PS4 at home, so there are 2 profiles on PS4. When we set our profile in PS4, we set the console as the primary console.  Now we want to buy PSN Plus subscription, and I want to know if the same subscription can be used in both profiles, or  only in one.   In case the same subscription can be used in both profiles, how can we set it up? Or is automatic? $A \cup B$ and $A \cap B$ connected $\implies A$ and $B$ are connected Let $X$ be a topological space. Let $A$ and $B$ be two subsets of $X$ such that: $A$ and $B$ are closed, $A \cup B$ is connected, $A \cap B$ is connected     Prove that $A$ and $B$ are connected.   Thoughts:  Suppose that $A$ is disconnected. Since $A$ is closed, there are two non-empty, disjoint, closed sets $E$ and $F$ in $X$ such that $A = E \cup F$. Then I attempted many things but all were not really useful.  Please help. Thanks.