public class Node&lt;T&gt; {     T data;     Node&lt;T&gt; next;     Node(T data){         this.data = data;     } }   public  class LinkedListUse{      public static void print(Node&lt;Integer&gt; head){         Node&lt;Integer&gt; temp = head;              while(temp != null){             System.out.print(temp.data +&quot; &quot;);             temp = temp.next;         }         System.out.println();     }          public static void increment(Node&lt;Integer&gt; head){         Node&lt;Integer&gt; temp = head;         while(temp != null){             temp.data++;             temp = temp.next;         }     }          public static void main(String args[]){              Node&lt;Integer&gt; node1 = new Node&lt;Integer&gt;(10);         Node&lt;Integer&gt; node2 = new Node&lt;Integer&gt;(20);         node1.next = node2;         increment(node1);         print(node1);     } }  Since node1 has been passed by value (and not pass by reference) in the function increment, hence the output should be 10 20 according to me, but the solution is 11 21. Can you please help me out with the explanation behind this
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?
Error message "sudo: unable to resolve host (none)" When I run sudo the terminal is stuck for a few seconds and then outputs an error message. My terminal looks like this:  ubuntu@(none):~$ sudo true sudo: unable to resolve host (none)   What can I do to solve it? Product of path connected spaces is path connected Will product of path connected topological spaces be necessarily path connected? Why or why not?  Give me some hints. Thank you. How does CoffeeScript's existential operator work? Can I color text by using an image, so that the color isn't flat? I'm using tikz to attempt to make a book cover, and I have a "wallpaper" image that looks like leather (not that I've handled that many leather-bound books). I'm using the node command to place text over the top of it, but none of the colors I've experimented with look decent.  Can I use an image of gold-leaf as the fill/stroke for the text? Or for that matter, for the path lines as well?  I've tried googling for this, but I can't figure out a set of keywords non-generic enough to pull back useful results. Connected compact covering space of torus is homeomorphic to $S^1\times S^1$ Redirect all requests to subdirectory except a few ip addresses We're all familair with this beautiful proof whether or not an irrational number to an irrational power can be rational. It goes something like this:  Take $(\sqrt{2})^{\sqrt{2}}$  If it's rational, then you proved it, if it's irrational, take $((\sqrt{2})^{\sqrt{2}} ){^\sqrt{2}} = 2$ and you've proved it.  I'm wondering if you can raise $\pi$ or $e$ to a certain non-trivial real power to make it rational? And if not, where is the proof that it can't be done?   p.s. - I almost left out the real part, but then I realized that $e^{i\pi} = -1$. How can i restrict /admin login page to a particular IP only? The recent  about a new supermassive virus being discovered got me thinking about how we define viruses as non-living organisms whilst they are bigger than bacteria, and much more complex than we first gave them credit for.   What biological differences between viruses and cellular organisms have made viruses be deemed non-living? Showing that two topologies give rise to the same topology How can I make an overset symbol at the same size and height as \bar except with a different symbol? Apologies for the cryptic title, but I was not sure how best to phrase the question in one sentence. I am essentially trying the create a vector symbol with \rightharpoonup as the top instead of the arrow.  The output to the following code will feature an overset harpoon over x, next to a simple \bar{x}. Observe that on the left, the top symbol is significantly higher and bigger than on the right one.  \documentclass{article}  \usepackage{amsmath,amsfonts,amsthm,amssymb}  \newcommand{\vect}[1]{\overset{\rightharpoonup}{#1}}  \begin{document} $$ \vect{x} \quad \bar{x} $$ \end{document}   I would like to create something that looks in every way like the right hand symbol, except using something that looks like \rightharpoonup at the top.  If this command sequence already exists in LaTeX, please use that as an answer, because I have searched for and failed to find it so far. Pass a PHP string to a JavaScript variable (and escape newlines) What is the easiest way to encode a PHP string for output to a JavaScript variable?  I have a PHP string which includes quotes and newlines.  I need the contents of this string to be put into a JavaScript variable.  Normally, I would just construct my JavaScript in a PHP file, à la:  &lt;script&gt;   var myvar = "&lt;?php echo $myVarValue;?&gt;"; &lt;/script&gt;   However, this doesn't work when $myVarValue contains quotes or newlines. Limiting sessions to one IP at a time On a site with premium user account subscriptions, I'd like to be able to limit logins to one computer at a time. The most straightforward way to accomplish this would be to limit by IP, but I haven't had any luck finding a plugin to accomplish this. Does anybody know of one I can use to get this functionality?  Related: How to make random dots in different sizes and spaces between the dots in Illustrator? I am trying to make something similar to this?  Obviously it's possible to make it manually piece by piece, but I am looking for some kind of automated feature in Illustrator to achieve this?  Is this possible?  Thanks man in advance! Find the number of dissimilar terms in the expansion of $$\bigg(x+\frac{1}{x}+x^2+\frac{1}{x^2} \bigg)^{20}$$  Could someone give me some hint to proceed in this question. I used $x+1/x=t$ and wrote expansion as $(t^2+t-2)^{20}$ but even this does not convey much information. Please help. Optimal bcrypt work factor Can I successfully bake previously-frozen bread dough? I want to uninstall VMware Player on my Ubuntu 12.04 LTS system. How should I uninstall it? Most people with a degree in CS will certainly know what . It helps us to measure how well an algorithm scales.   But I'm curious, how do you calculate or approximate the complexity of your algorithms? How to Setup GIMP 2.10 on Ubuntu 16.04 (Xenial Xerus)