When passing String a to myFunction() , I pass the reference. Why when it exits, the reference points to the old String ? Doesn't it use the real reference to the string ?   import java.time.*;  public class Main {     public static void main(String[] args) {         String a = "aaa";          myFunction(a);          System.out.println(a);     }      private static void myFunction(String a) {         a = a + "111";         System.out.println(a);     } }
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?
Acne underneath skin Introduction  Okay, I've almost won my war. The battle, its almost won... However, I must still claim victory in my final battle. The battle against the little enemies, the ones that have fought with my blade of benzoyl peroxide every single day.  Problem  Through spot treatments I have been able to fell every single one of these spots, but only the ones on my face. I've been using a spot treatment with benzoyl peroxide in, which has worked really well for me. However, my issue comes here:     There are spots underneath my skin, I think. The areas where they come through are a bit red.   So, because there is still slightly red skin on my face, and I think this is causing my acne to constantly return. I need to stop this, and end my war once and for all.  What I've tried   Washing my face with a rag and sponge every day, three times a day Changing my pillow case every day Using a benzoyl peroxide spot treatment Minimizing how much I touch my face Not interfering with the spots with my fingers, not picking at them, not playing with them. Just letting spot creams eradicate them.   Conclusion  Seriously, this driving me up the wall. I spot cream in the evening, by the time tomorrow has ended and its time for a shower, they've all come back. Its like they're coming in waves, damn waves! I must put an end to this.  So, how can I prevent acne from coming back within the space of a single school day? How can I get rid of these once and for all? What types of measures could I try? I have no reason to visit my doctor, its only acne, but I have no idea what I can try now.  Is there even a point in me trying? I acknowledge that I am a teenager, but no others that I know seem to have acne/spots like I do. Why is super.super.method(); not allowed in Java? How do I remap the Caps Lock and Ctrl keys? I'd like to remap my keys such that Ctrl behaves as the Caps Lock key and vice-versa. Also, if possible I'd like the settings to be available only within the currently logged-in user. How can I achieve this?  I'm a vim user, unlike the other people who use this machine, so I'd like those settings only for my account. $15x\equiv 20 \pmod{88}$ Euclid's algorithm Use Euclid's algorithm to find a multiplicative inverse of 15 mod 88, hence solve the linear congruence $15x\equiv 20 \pmod{88}$  So far I have:   $88=5\cdot15+13$  $15=1\cdot13+2$  Backwards substitution gives  $15v+18w=1$   $1=15-1\cdot13$   $=15-1(88-5\cdot15)$   $=15\cdot15-1\cdot88$   now very stuck what to do from here:( How to define a figure size so that it consumes the rest of a page? Sometimes I don't need to have a specific picture size, but for layout reasons I would like to scale the image so that the rest of the page is filled. How can I achieve that? Understanding the formula for the Confidence Interval of the difference between two sample proportions How to find the kth largest element in an unsorted array of length n in O(n)? I believe there's a way to find the kth largest element in an unsorted array of length n in O(n).  Or perhaps it's "expected" O(n) or something.  How can we do this? Black hole "no hair" theorem The  (or conjecture), suggests that black holes can be entirely described by their mass, angular momentum and charge. All other details of the BH formation are lost.  Is there a simple way of understanding why you would be able to tell the difference between a BH made from protons and one made from electrons, but not between one made from matter rather than anti-matter?  i.e. What is special about charge, and why aren't lepton number, baryon number, strangeness etc, also black hole properties? Did this character even qualify for being Azor Ahai or The One Who Was Promised? In the books and to some degree in the show as well there is a prophesy about the legendary figure Azor Ahai. But in the latest Game of Thrones episode (S08E03) we see Arya      killing the Night King.   However in a  we discussed​ all possible candidates but nobody thought about Arya. Does she even fulfill the prophecy? If she does, how? How to extract img src, title and alt from html using php? I would like to create a page where all images which reside on my website are listed with title and alternative representation.  I already wrote me a little program to find and load all HTML files, but now I am stuck at how to extract src, title and alt from this HTML:  &lt;img src="/image/fluffybunny.jpg" title="Harvey the bunny" alt="a cute little fluffy bunny" />  I guess this should be done with some regex, but since the order of the tags may vary, and I need all of them, I don't really know how to parse this in an elegant way (I could do it the hard char by char way, but that's painful). What is the probability that the selected function maps prime numbers to prime numbers? Let $X = \{1, 2, 3, . . . , 25\}$. If a student selects a function randomly from the set of all functions from $X$ onto $X$, then what is the probability that the selected function maps prime numbers to prime numbers ? No idea how to proceed, please guide. I'm a little confused about the following sentences. Could you please tell me which one(s) is/are correct?        The first and the second chapter are difficult.   The first and the second chapters are difficult.   The first and second chapters are difficult.   The first and second chapter are difficult.      I believe #1 &amp; #3 are correct, while #2 &amp; #4 are incorrect.  But when seeing the answers to the Quora question , I wonder why they say #2 is correct. Sometimes when attempting to capture a Pokémon, the mon will be wiggling in the ball and the app will disconnect from servers (for mobile connection reasons or whatever), and I'll be left staring at a ball containing Schrodinger's Pokémon. I'll sigh at the loss (or in the case of a 500CP Pinsir, scream in agony), and reload the game.  I thought maybe encounters in general couldn't handle disconnecting well, but sometimes immediately after a Pokémon broke free of a ball, the little icon in the upper left would appear, the game would stall for a bit, but it would recover.   Is there anything I can do to avoid this? Should I be waiting it out, instead of reloading?  (and before anyone says it, yes I have filed a bug report) How do I change text on the submission button in the node form? Was voldemort's body going to die? Voldemort has gained "immortality" via his horcruxes, but was his body immortal to age? Looking at all the questions about Voldemort and his horcruxes what was his plan to keep his body alive. We know his first Horcux was created at age 16, yet we see him age still so it seems like eventually his body would die of old age and his soul would be left in the half dead state he was in after his spell rebounded off Harry. What was his plan here, why would he not want something such as the elixir of life to keep his vitality?     While the Elixir of Life does indeed extend life, it must be drunk regularly, for all eternity, if the drinker is to maintain his immortality. Therefore, Voldemort would be entirely dependent on the Elixir, and if it ran out, or was contaminated, or if the Stone was stolen, he would die just like any other man. Thereafter, I am convinced, he intended to continue to rely on his Horcruxes: he would need nothing more, if only he could regain a human form. He was already immortal, you see ... or as close to immortal as any man can be.' (Albus Dumbledore)   Horcruxes seem to fail at something important, keeping you alive, they stop you from dying truly yes, but they don't keep you alive. Harry is shown over and over again to be able to beat better wizards because hes has faster reflexes both because of youth and his genetics, but presumably by 50 harry will not be as fast as his 16 year old self even considering their longer life expectancy. Why operate in a body of a 50 year old? How to get the pid of the last executed command in shell script? I want to have a shell script like this:  my-app &amp; echo $my-app-pid   But I do not know how the get the pid of the just executed command.  I know I can just use the jobs -p my-app command to grep the pid. But if I want to execute the shell multiple times, this method will not work. Because the jobspec is ambiguous. How to avoid nested With[]? How can I get back a system file after deleting it from my Mac? I've deleted a system file from my Mac and need to get it back.  System files can include:   hidden files in the root of / - especially unix files in /private  /System files /Library files /Applications files that ship with the core OS   System files are not any app, user files or files that can be regenerated by a known sequence such as cache files, Spotlight index files, etc…    Canonical question and answer for . Hint:  $a^2 -ab +b^2 = (a+b)^2 -3ab.$  I know we can say that there exists an $x,y$ such that $ax + by = 1$.  So in this case, $(a+b)x + ((a+b)^2 -3ab)y =1.$  I thought setting $x = (a+b)$ and $y = -1$ would help but that gives me $3ab =1.$  Any suggestions? Are GUID collisions possible? I'm working on a database in SQL Server 2000 that uses a GUID for each user that uses the app it's tied to. Somehow, two users ended up with the same GUID. I know that microsoft uses an algorithm to generate a random GUID that has an extremely low chance of causing collisons, but is a collision still possible?