Maybe my question will be so much silly for 2016 because there exist many similar questions but it is very hard to me to understand when should i use final variable inside a method instead of local variable. Which  one will be more efficiency and when should i use it.    public void setmethod(int var)  {        final int variable = var;        System.out.println(variable);  }      public void setmethod(int var)  {        int variable = var;        System.out.println(variable);  }   I know that The result in the Output will be the same and also that Final fields - is making that same fields reference immutable but which one option is more efficiency under certain circumstances and Why?? I am a bit confused
I've found a couple of references () that suggest using final as much as possible and I'm wondering how important that is. This is mainly in the the context of method parameters and local variables, not final methods or classes. For constants, it makes obvious sense.  On one hand, the compiler can make some optimizations and it makes the programmer's intent clearer. On the other hand, it adds verbosity and the optimizations may be trivial.  Is it something I should make an effort to remember?
How did the Swooping Evil Venom infused rain affect the magical community? How do I set the grub timeout and the grub default boot entry? In Ubuntu 12.04 (or above), how do I set the GRUB time and the default OS (that I see at boot time) as I'm dual-booting Windows (7/8) and Ubuntu (12.04 or above)? Why are there directories called Local, LocalLow, and Roaming under \Users\\AppData? I have a workstation running Windows Server 2008 that's logged into an  domain, and I have a dual boot with Ubuntu Linux. When running Linux, I'd like to be able to use the same Thunderbird profile I use under Windows, so I pointed Thunderbird to use a profile I found under:  \Users\(myname)\AppData\Local\Thunderbird\Profiles   It turns out it was not the correct profile -- it had the right configuration, but the Inbox was an old version. I eventually found out the correct path was:  \Users\(myname)\AppData\Roaming\Thunderbird\Profiles   What's the rationale behind those different places to store application data? Converse to Hilbert basis theorem Prove the converse to Hilbert basis theoren:     If the polynomial ring $R[x]$ is Noetherian, then $R$ is noetherian. SSH tunnelling with multiple dynamic port forwardings I am trying to monitor multiple JVMs running on different servers through an ssh tunnel.  Thanks to one of the UNIX gurus here, I have managed to get this running for a single server by:   Run jstatd on the target server Set up Visual VM to use 9696 as its socks proxy port. On my local PC, run:  ssh -L 2222:server1:22 bastion-host  On my local PC, run:  ssh -o port=2222 -D 9696 -L 1099:localhost:1099 localhost    This does the trick. Now when I try and tunnel to a second server I try:   On my local PC, run:  ssh -L 3333:server2:22 bastion-host  On my local PC, run:  ssh -o port=3333 -D 9696 -L 2099:localhost:1099 localhost    However, the last step complains with:  bind: Address already in use channel_setup_fwd_listener: cannot listen to port: 9696   Has anyone managed to do something similar?  Update:  The reason this is so complex is that jstatd is an RMI server application:    As with RMI applications, these register with an rmiregistry. Using rmi through a firewall requires me to use SOCKS as described here:    Unfortunately, visualvm only lets me set the SOCKS proxy port once, and the -D option won't allow me to forward the same local port to both servers... Want to copy the file name quickly in Windows. I always use rename, copy , but feel it is quite slow. Any better way? Unable to modify files/folders in NTFS partition So this homework question is in the context of $\mathbb{R}$ only, and we are using Lebesgue measure.  The sum $A+B$ is defined to be $A+B=\{a+b|a\in A,b\in B\}$. The question is: If $m(A),m(B)&gt;0$, is it necessarily the case that $A+B$ contains an open interval?  This question is quite annoying, since it is quite difficult to calculate the sum even after you construct an example. However, it seems like no matter how I constructed a set of positive measure, there is a region that have a lot of point in it (yet this region is not necessarily dense). This suggest that when summed up, the holes should be covered up somehow and thus there would be an open interval, and so the answer is yes. Sorry for a rather vague idea, but I'm just not sure what to do with this problem. I have a feeling that somehow topology would have a way to capture precisely the idea above about a region with a lot of point.  (also, I think my middle school teacher mentioned this once, and I remembered the answer to be yes; but that is quite a while ago though)  Thank you. Any help will be appreciated.  EDIT2: So Camilo's answer is gone. I am looking at the convolution method right now. Because the convolution is continuous, if it is nonzero I am done. But then there is no guarantee that the convolution is nonzero even if $x\in A+B$. I still need help with this direction. Can someone give me some hints?  EDIT: Camilo's answer below essentially suggest the method of getting 2 open interval from regularity theorem, one cover a subset of A and one cover a subset of B such that the sum of the measure of these two subset is bigger than the measure of the larger interval. user99680's answer point to a wiki which show a method that essentially simply acquire an open set. After some thinking, I believe that these method simply can't be made to work. I constructed this example in the hope that it would convince you that it is the case:  Let $I_{0},I_{1},\ldots$ be disjoint open interval such that the distance between any 2 of them is nonzero and $m(I_{n})=9^{-n}$ and all of them are inside $[0,2]$. Let $J_{0},J_{1},\ldots$ be disjoint open interval such that the distance between any 2 of them is at least $3$ and $m(J_{3n})=m(J_{3n+1})=m(J_{3n+2})=\frac{m(I_{n})}{3}$. Let $O=\bigcup I_{n}$ and $H=\bigcup J_{n}$. Construct $A\subset O$ such that $m(A\bigcap I_{n})=\frac{3m(I_{n})}{4}$. Construct $B\subset H$ such that $m(B\bigcap J_{n})=\frac{3m(J_{n})}{4}$. Now if you apply Camilo's method, it is possible that your $I$ would be one of the $I_{n}$ above, and your $J$ is one of the $J_{m}$ above. No matter which $I_{n},J_{m}$ you have, the argument does not work. Rewrite $m=3q+r$ where $0\leq r\leq 2$. If $q&lt;n$ then $m(J_{m})&gt;m(I_{n})$ so the longer interval have length $\frac{m(I_{q})}{3}$; $m(A\bigcap I_{n})$ is at most $\frac{3m(I_{q+1})}{4}=\frac{m(I_{q})}{12}$ and $m(B\bigcap J_{m})=\frac{3m(J_{m})}{4}=\frac{m(I_{q})}{4}$. Thus $m(A\bigcap I_{n})+m(B\bigcap J_{m})$ is no larger than the larger interval. If $n\geq q$ then $m(I_{n})&gt;m(J_{m})$ so the larger interval is of length $m(I_{n})$; $m(A\bigcap I_{n})=\frac{3m(I_{n})}{4}$ and $m(B\bigcap J_{m})$ is at most $\frac{3m(J_{3n})}{4}=\frac{m(I_{n})}{4}$. Once again $m(A\bigcap I_{n})+m(B\bigcap J_{m})$ is no larger than the larger interval. Hence the Camilo's argument does not work. user99680's method does not work either, since you get $O$ and $H$ which is even bigger than any interval. My little brother is just getting into programming, and for his Science Fair project, he's doing a simulation of a flock of birds in the sky. He's gotten most of his code written, and it works nicely, but the birds need to move every moment.  Tkinter, however, hogs the time for its own event loop, and so his code won't run. Doing root.mainloop() runs, runs, and keeps running, and the only thing it runs is the event handlers.  Is there a way to have his code run alongside the mainloop (without multithreading, it's confusing and this should be kept simple), and if so, what is it?  Right now, he came up with an ugly hack, tying his move() function to &lt;b1-motion&gt;, so that as long as he holds the button down and wiggles the mouse, it works. But there's got to be a better way. A guy scammed me, but he gave me a bank account number & routing number. Can I use that to take out what he owes me? Why can't I chown a VirtualBox shared folder? When does decision tree perform better than the neural network? Is there any shorter pronunciation of W than double-U? When spelling, every letter in the Alphabet is pronounced by a single syllable, with the only exception of W being pronounced "double-U". (Fun fact, in German it's approximately pronounced like the "ve" in very, but in some strike of cosmic justice Y is pronounced "Yps-e-lon") Why is that? Is there any at least semi-officially accepted one-syllable alternative pronunciation of W?  I checked some related post, e.g. , but they are more concerned with the "Why?" instead of the "Why not different?" Limit at infinity of $x^{1/x}$ I encountered a problem: calculate $\lim\limits_{x\to\infty} x^{1/x}$  My solution is quite weird and I find no document explaining whether I am right or wrong!  My solution:  As $\lim\limits_{x\to\infty} 1/x = 0$  then $\lim\limits_{x\to\infty} x^{1/x} = \lim\limits_{x\to\infty} x^0  = 1$  My question is: Whether I am right or wrong, and could you please explain why? Are units in English singular or plural? I have the following reference:  @MISC{EX2012,   author = {{S}ingle {A}uthor {O}rganization},   year = {2012},   title = {Example} }   A citation for this is breaking after "Author", but extending beyond the margin, as shown in the following example layout in the PDF:  Demo text demo text demo to margin Demo text which cites it (Single Author Organization, 2012) and flows over the margin.   How can I solve this? I am using natbib and citing with \citep{EX2012}. Which badges do not cause a notification for experienced users? Yesterday, I have received two : Revival, and Self-Learner. However I was only notified of the Revival badge, because apparently the Self-Learner badge is not considered "".  What badges have their notification suppressed if the user has a 200-rep account somewhere on the Stack Exchange network, i.e. they won't trigger a new item in our achievements dialog? $d = \gcd(c,m),\ ac≡bc\pmod{\! m}\Rightarrow a≡b\pmod {\!m/d}\ $ [Congruence Cancellation & Division Rule] How would you show that if $ac≡bc$ $\mod m$ and $\gcd(c,m)=d$, then  $a≡b$ $\mod \frac{m}{d}$?  Any help would be much appreciated! When do merchants start paying the actual value of items without bonus effects and perks? Contraction of Kronecker delta = 4 This suggests, as a shortcut notation, the concept of lowering indices; from any vector we can construct a (0, 1) tensor defined by contraction with the metric: $$A_\nu ≡ g_{\mu\nu}A^\mu$$  so that the dot product becomes $$g_{\mu\nu}A^\mu B^\nu = A_\nu B^\nu$$  We also define the inverse metric $g^{\mu\nu}$ as the matrix inverse of the metric tensor: $$g^{\mu\nu}g_{\nu\rho} = δ^\mu_\rho$$  where $δ^\mu_\rho$ is the (spacetime) Kronecker delta. (Convince yourself that this expression really does correspond to matrix multiplication.) Then we have the ability to raise indices: $$A^\mu = g^{\mu\nu}A_\nu$$ Note that raising an index on the metric yields the Kronecker delta, so we have $$g^{\mu\nu}g_{\mu\nu} = δ^\mu_\mu = 4$$  I don't understand why $δ^\mu_\mu = 4$. Shouldn't it equal 1?