I have this piece of code, and I would like to know why the reference of my variable x is not modified ? It still points to the first object assigned:  public class HelloWorld{   public static void main(String []args){     Object x = new Object();     Object y = x;     mutate(x);     System.out.println(Integer.toHexString(x.hashCode()));     System.out.println(Integer.toHexString(y.hashCode()));     System.out.println(x == x); // true     System.out.println(x == y); // true  }   public static void mutate(Object x) {      x = new String();  }   }
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?
Rationalize   $\dfrac{1}{\sqrt[3]{p^2}+\sqrt[3]{pq}+\sqrt[3]{q^2}}.$  How would I go about doing this without wading through lots of algebra?  Is there a trick similar to how you can multiply by $\dfrac{\sqrt a-\sqrt b}{\sqrt a-\sqrt b}$ with square roots?  Thanks in advance! Mass retagger badge I've been busy retaggin questions since I got my retag privileges.  Shouldn't there be an incentive to retag wrongly tagged questions, other than the urge to do things right?  I'm mean, the only "badge incentive" for retagging are "Firs edit" (Organizer) and "Creation of a tag used 50 times" (Taxonomist). The first one is easy to get, and the second one, right now in SO is almost impossible to get without cheating, that's editing 50 questions with an unlikely tag. Taxonomist I guess, could encourage wrongly tagging.  Is this really a problem?  We could have an "Tagged 200 question" badge, so people go for that badge, instead of taxonomist. Evaluation of $\int_{-\infty}^\infty \frac{\sin(at)}t\ dt$ I just need to know if this integral converges.  If it does, what is the value?  If not can anyone tell me what is the value of the $$ \int_{-\infty}^\infty 2\,\frac{\cos(w)\sin(w)}{w}\ dw ? $$ How can I reject all changes in a Linq to SQL's DataContext? On Linq to SQL's DataContext I am able to call SubmitChanges() to submit all changes.  What I want is to somehow reject all changes in the datacontext and rollback all changes (preferable without going to the database).  Is this possible? Convergence of $\int\limits_1^{\infty}x^\alpha\sin(x^\beta)dx$ I need to show that $$ \int\limits_1^{\infty}x^\alpha\sin(x^\beta)dx $$ converges if and only if $\alpha + 1 &lt; \beta$. I used substitution and integration to get $$ \lim\limits_{t\to\infty}\int\limits_1^tx^\alpha\sin(x^\beta)dx \overset{u = x^\beta}{\underset{du = \beta x^{\beta-1}}{=} }\lim\limits_{t\to\infty}\left(\frac{1}{\beta}\int\limits_1^{t^\beta}u^{\frac{\alpha + 1 - \beta}{\beta}}\sin{u}du\right) $$ If $\alpha + 1 -\beta &lt; 0$, then we have a product if a function with bounded anti-derivative and a differentiable decreasing function which tend to 0, and from Dirichlet's criterion, the integral converges.   For the converse, I used integration by parts $$  = \frac{1}{\beta}\lim\limits_{t\to\infty}\left(\left.-u^{\frac{\alpha + 1-\beta}{\beta}}\cos{u}\right|_1^{t^\beta} + \frac{\alpha+1-\beta}{\beta}\int\limits_1^{t^\beta}u^{\frac{\alpha + 1-2\beta}{\beta}}\cos{u}du\right) $$ For $\alpha + 1 -\beta\geq 0$, I get that the first term indeed diverges, but this is not enough to show total divergence. How can one show it? Probability Number A greater Number B Given $a \in \{1,2,...,250\}$ and $b\in \{0,1,...,1000\}$  What is the probability that $a &gt; b$?  I know there already is  question with a very similar question, however it's over an interval of $\mathbb{R}$ so I hope there is another way opposed to the Integral used in the formal solution.  How does one go about calculating said probability? Random point uniform on a sphere If $X=(x,y,z)$ is a random point uniform on the unit sphere in $\mathbb{R}^3$,  Are the  coordinates $x$, $y$, $z$ uniform in interval $(-1,1)$? When do I clear US customs and immigration if connecting at a US airport to my final destination elsewhere in the US? Markov's paper on insolubility of the homeorphy problem I would like to convert a large LaTeX project (i.e. spanning multiple files) into plain text. The purpose is generation of statistics, so representing mathematics is not an issue. In fact, all mathematics is ideally ignored.  I have found  but could not get it to run. It seems unfinished, but is exactly what I am looking for otherwise. Prove that the function : $f(x) = x$ when $x$ is rational and $f(x) = 1 - x$ when $x$ is irrational is continuous at $x = \frac{1}{2}$  To prove the continuity it is necessary to prove that for every $\epsilon$ there exists a $\delta$ such that $|f(x) - f(\frac{1}{2})| &lt; \epsilon$ whenever $|x -c| &lt; \delta$ $- (1)$ Now if we choose $a  € (\frac{1}{2} - \delta, \frac{1}{2} + \delta)$ and also $a $ is rational and choose $\epsilon &lt; |a - \frac{1}{2}|$ then condition in $(1)$ is not satisfied. How to move from here? Intuition on the Kullback-Leibler (KL) Divergence Let $G$ be a graph of minimum degree $k&gt;1$. Show that $G$ has a cycle of length at least $k+1$.  How would I show this? I understand that a cycle is a sequence of non-repeated vertices and the degree of a graph is the number of neighbors the vertex has. Biblatex + Xelatex does not display accents I have a series of layers of lines (shapefiles) in My Project. The CRS of some are different and to merge them they all must have same CRS.  When I use Processing/Toolbox/Qgis_algorithims/Reproject_layer the reprojection only works if it is allowed to save to temporary file somewhere (it will not change the CRS when I reproject if I try to save and replace it in My Project directory);   I must remove the original from the layer list and reproject the temp file (without changing the CRS) to get it into my project and name it appropriately.  Is there a better way to reproject a layer in Qgis? sci-fi book where a meteorite gives 3 different kinds of telepathic powers to people who then vie for control 3 groups of telepaths each with different powers.  They received their powers from a meteorite.  One group is the strongest and are kind of in control.  Another group wants to gain control.  One group, I believe the strongest, have telepathic battles to determine the strength of one another conjuring up swords, walls, etc. in their minds. It was written by a lawyer.  Could have been written in the ‘80s, or earlier. How is it possible for the Root Name Servers to handle all DNS requests? I was reading about DNS some days ago and learned how the requests are processed. If you surf to www.example.com, then a request will go to the Root Name Servers to see who owns that .com address, then another request will go to another, more local, DNS server to see who owns the example.com address and so on.  How is it technically possible that the 13 Root Name Servers can handle all requests done by earth's billions of Internet users simultaneosly without beeing ddos:ed? Reference label with included file and relaxed clearpage I am running into a rather weird error that apparently originates from the combination of \include, \let\clearpage\relax and a referenced label after a page break.  In this particular example, the label mylabel defined in the listing cannot be referenced anymore when the reference and the label are close enough to a page break.  The MWE consists of two files, the main-file and an included file. I am using the \let\clearpage\relax command to . The error does not occur if the file is \input instead of \included.  \documentclass[11pt,twoside]{book} %  \usepackage[utf8]{inputenc} % Enoding \usepackage[english]{babel} % Language \usepackage{listings} \usepackage{forloop}  \begin{document} \begingroup \let\clearpage\relax  \include{includedfile} % changing include for input would work  \endgroup \end{document}   Included file:   \newcounter{ct} \forloop{ct}{1}{\value{ct} &lt; 40}% {%     .\\ }  Listing \ref{mylabel}.  \begin{lstlisting}[caption=somecaption, label=mylabel] some code; \end{lstlisting}   Running this example will have an output where the label cannot be referenced (even after multiple runs):    Now, one solution is to use \input as mentioned earlier but I am rather interested in why this happens. Does the \clearpage command fulfil an important function for references to work? And can the error be avoided without removing \let\clearpage\relax while using \include?  EDIT: I just found  with the same issue (though it does not have a definite answer). Is it okay to use the phrase "try and"? Is it grammatically correct? e.g. "I will try and answer ..." I read the following sentence in book (App).     I will try and answer any questions you ask.   Why don't they use the following? (it is much common):     I will try to answer any questions you ask.   Is there any difference in meaning?  Update:  I noticed that a lot of books and news websites are using this phrase:        Although Katty will try and answer as many questions as she can.    He puller would have a chance to try and answer the question on her own ... High Memory Usage on Linux Server