I am beginner in Java and i have a question while trying to learn Strings . In the below program  String st1="Test"; String st2="TEST"; String st3= st1.toUpperCase();  if(st3 == st2) {     System.out.println("Equals");  } else     System.out.println("Not Equals");   O/P for the above program displays as "Not Equals" where as i was expecting "Equals" Since "TEST" already exist in String Pool,  st3 should have pointed to already existing String rather than creating a new String.  Kindly explain the behavior. Thanks in advance
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Prove, in this figure, that $EFGH$ is a parallelogram What's the best way of replacing a plug or switch in a house with aluminum wiring? Probability of complete coupon set in $K$ boxes where a box has $N$ distinct coupons? Say there is a contest to collect a full set of $M$ coupons.  Each box of product has $N$ distinct coupons of the $M$ possible coupons in it, selected uniformly without replacement from the $M$ possible coupons, the same $N$ in number for all boxes.  I'm interested in the probability that after opening $K$ boxes of product I have at least one complete set of the $M$ coupons.  My attempt has been to take the probability of a coupon not being in a box, use that to determine the probability of that coupon not being in any of the $K$ boxes, and then... I get flummoxed, and don't think this is the correct approach.  I searched the site for coupon collector problems, there are a couple that deal with similar situations (multiple in a box), but with the box having coupons selected with replacement, so duplication in a box is possible.  Right now I'm using a CAS to get probability of sums of hypergeometric samples having all bins covered to check my ideas, but that's utterly impractical for other than tiny cases.   Is this not as trivial as I think it is, or is there a direct way to calculate this? When I´m in a secure part of a web-site I´m developing (entering a specific page or folder using https), the relative links to the normal pages are automatically converted to https as well. Is there a way to tell an &lt;a&gt; tag to always use the http protocol instead of the https protocol (or the other way around)? I know it´s easy using the complete link ( or ), but I would like it to work with relative links (index.html, ../index.html, etc.). In the following is it better to use a possessive noun with an apostrophe or an attributive noun without an apostrophe?     The following list details the assumptions that have been made in   conjunction with the Dell Company’s staff.   Or      The following list details the assumptions that have been made in   conjunction with the Dell Company staff.   Assume Company is the name of a company, such as Dell. This is supposed to be related to the  (my justification for the independence tag). In Williams' Probability with Martingales, 2BCL is proven and then the following is given as an exercise:  Prove $S \doteq \sum_{n=1}^\infty p_n &lt; \infty \implies \prod_{n=1}^\infty (1-p_n) &gt; 0$ assuming $0 \leq p_n &lt; 1$. Hint: Show that $S &lt; 1 \implies \prod_{n=1}^\infty (1-p_n) \geq 1 - S$.   Proving the hint: I tried to find $\{a_n\}$ s.t. $$\prod_{n=1}^\infty (1-p_n) \geq \prod_{n=1}^\infty e^{a_n} = e^{\sum_{n=1}^\infty a_n} \geq 1 - \sum_{n=1}^\infty a_n \geq 1 - S &gt; 0$$ That is, find $\{a_n\}$ s.t.: 1a. $1 - p_n \geq e^{a_n}$ 1b. $a_n \leq p_n$ I thought of $a_n = \ln(1-p_n)$ (a reason why $p_n &lt; 1$, I guess) Is that right? Edit: Actually, assuming my proof is right, is $S &lt; 1$ used in the proof? If so, where?  From Williams book: How to change the monitor's refresh rate? How do I change the monitor's refresh rate in Oneiric?   There is no option to do it in the Displays dialog now. By default it's 60Hz, but I need 75Hz on my monitor.  In previous releases there used to be such an option in the Displays dialog.  Edit - Half baked solution  The best I could do so far was:  xrandr -s 1280x1024 -r 75   This is perfect, but my problem is that it isn't permanent. It defaults back to 60 Hz after logging out and back in.  Perhaps this should go into some script and added to startup? I just don't know how to do that. Associativity of Cartesian Product Prove $ \sin(A+B)\sin(A-B)=\sin^2A-\sin^2B $ How would I verify the following double angle identity. $$ \sin(A+B)\sin(A-B)=\sin^2A-\sin^2B $$ So far I have done this. $$ (\sin A\cos B+\cos A\sin B)(\sin A\cos B-\cos A\sin B)  $$But I am not sure how to proceed. Don't impose delay loading Close dialog when you haven't just loaded it Prove that if $A$ is an infinite set then $A \times 2$ is equipotent to $A$ I want to prove that if $A$ in an infinite set, then the cartesian product of $A$ with 2 (the set whose only elements are 0 and 1) is equipotent to $A$.  I'm allowed to use Zorn's Lemma, but I can't use anything about cardinal numbers or cardinal arithmetic (since we haven't sotten to that topic in the course).  I read a proof of the fact that if $a$ is an infinite cardinal number, then $a+a=a$, which is something similar to what I want to prove.   Any suggestions will be appreciated :) Can you win a game of Splendor if you still have cards in reserve? Which one of these two statements is correct?     Our staff do ...      Our staff does ...   And is staffs ever correct? How do you concatenate matrices? And how do you make block matrices? Fantasy novel: magic school, talking rabbit, character bites off another character's fingers The plotline as a whole is completely lost to me, but it was a big inspiration to my preteen self at the time and has shaped my creative development up to now. I'll list some of the big points that I can recall from it, if anyone has the vaguest idea what book I am referring to I would be so appreciative for any guess! I just want to reread it.   Main character is a delinquent of sorts, goes to a magic school. I don't remember there being any pictures in this book. There is a threesome between the main character and his two friends I believe it is a talking rabbit that says something along the lines of "My dear child, you are incensed", followed by one of the characters saying something like "Damn right I am!" A character that had been mentioned earlier but never made an appearance (he was banned for doing bad magic I think) shows up to fight and he bites off another character's fingers. Main character seeks out a magical white stag near the end of the novel because the stag can grant a wish if it's caught because he wishes to reset his timeline. The stag is able to speak. Find all functions $f$ such that $(x+y)f(x)+f(y^2)=(x+y)f(y)+f(x^2)$ Parallel file copy from single source to multiple targets? I have a several large files on optical media I would like to copy to multiple targets - in this case I have two hard drives attached to the same computer. Is there a utility that can function like:  copy source target1 target2 ... targetN White background with filmic blender Use mathematical induction to prove that 6(n+2) + 7(2n+1) is divisible by 43 for n >= 1.  So start with n = 1:  6(1+2) + 7(2(1)+1) = 63 + 73 = 559 -> 559/43 = 13. So n=1 is divisible  Let P(k): 6(k+2)+7(2k+1) , where k>=1  Show that P(k+1): 6((k+1)+2) + 7(2(k+1)+1) is true  = 6(k+1+2) + 7(2k+2+1)  = 6(k+3) + 7(2k+3)  I'm unsure where to go from here, I've tried several directions after this but have got nowhere. I don't know how to get the 43 or 559 out the front.  Any help would be great Force Messages to use SMS for specific contact rather than iMessage? Essentially, I would like to set my phone so that all my outgoing messages to a specific friend, with whom I currently text back and forth over iMessage, are sent out over SMS, never iMessage. Additionally, I would like to block any incoming iMessage texts of his and (hopefully) they'll fail and be resent via SMS.  Let me restate that: I would like to force SMS for both parties, going both ways, for a specific individual contact.   Is this possible? Blocking any usage of iMessage between myself and this other individual, so they must either send and receive any texts to or from me via SMS (or the texts fail/never arrive).