I`m trying to write java program that take license number from one file and put it in another file. This what I wrote until now:  import java.io.File;  import java.util.Formatter;  import java.util.Scanner;  public class license {      public static void main(String[] args) {         openFile();         readFileAndConvert();     }      private static Scanner x;      // Open original license file      public static void openFile() {          try {             x = new Scanner(new File("C:\\Users\\me\\Desktop\\originalLicense.txt"));         } catch (Exception e) {             System.out.println("Error");         }     }      public static void readFileAndConvert() {          String licenseNum;         Formatter newLicense = null;          while (x.hasNext()) {             licenseNum = x.next();              if (licenseNum == "123") {                    try {                     newLicense = new Formatter("C:\\Users\\me\\Desktop\\newLicense.txt");                 } catch (Exception e) {                     System.out.println("Error");                 }                 newLicense.format("%", licenseNum);             }         }     } }   I used youtube videos to write this and now I can`t find the problem, Is anybody can guess what can be the problem?
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?
Determine the number of ways to colour a 1 by n grid using the colours red and white if an even number of squares are to be coloured red. JSF 2.1 ViewScopedBean @PreDestroy method is not called If $z$ lies on the circle $|z-1|=1,$ then the value of $\frac{z-2}{z}$ is If $z$ lies on the circle $|z-1|=1, $ then the what is the value of $\frac{z-2}{z}$ ($z\ne 0 \ \text{and} \ 2$ ) is?  What I am aware of : the equation $|z-1|=1$ represent a circle with  centre $(1,0)$ and radius $1$. Also $$|z-1|=1 \implies (z-1)^2=1 \\ \implies  z^2-2z+1=1 \implies z(z-2) =0$$ $\implies z = 0; z =2 $ I think this is wrong.. please suggest thanks.. Pumpkin Noodles is a thing or are a thing? Which of the following is correct?  How come pumpkin noodles is not a thing?  or  How come pumpkin noodles are not a thing?  I want to post one of the above statements to Twitter with a picture of a bowl of pumpkin noodles i.e. the stuff that comes out of a hollowed out pumpkin. I had recently taken the hard drive out of my computer so that I could install a bigger one. But when I reconnected it to the computer, all the files on the E:\ partition and some of the files on the C:\ partition had strange names like TTv5yV5354$YVC5Wy on them. I did on one occasion move an electromagnet near the drive. Could that have caused this? Please help me, some of those files were valuable. How to pick one number from each sorted list so that the difference between the minimum and maximum is as small as possible? KOMA-Classes (scrbook, scrreprt, ... ): Disable chapter separation in \listoffigures and \listoftables I use \listoffigures and \listoftables. Both commands create line breaks for items from different chapters. How can you stop that?  Screenshot: Include the "People Reached" and "Helpful Flags (count)" data in SEDE I know the new profile design hasn't been updated for  on the network yet, so maybe this is a bit too early. Nonetheless, please include the &quot;People Reached&quot; data in  at your earliest convenience. Also, I was just made aware that users helpful flag counts are now publicly displayed on their  towards the top-right, underneath the people reached stat. So please include this data in SEDE as well. How to change default user in WSL Ubuntu bash on Windows 10 Importing a Single Symbol From a Different Font Remove Gnome Notifications or set Permanent Do not Disturb Find the general solution of $y'= a^{x + y}$ where y is the function Advantages of parallel over serial connections As far as my understanding goes, parallel data connections are faster than serial at the same frequency. However, when you increase the frequency in parallel you start getting bits 'cross-talking' and getting transferred onto the next bus. Serial however, since it's only a single bus line, can have the frequency increased to make it faster than parallel without a problem. Also, surely parallel is more expensive as it uses more lines.  So my question is, what actually is the benefit of using a parallel data connection over a serial one? Are there any? If not, why do we still use parallel connections? raw_input in python without pressing enter How to understand the Ubuntu file system layout? How do trees lift water higher than 10 meters? The atmosphere pressure is 10 meters of water (approx). This means that it is impossible to lift water higher than 10 meters with vacuum or сapillary action (on Earth, under normal conditions).  There are trees higher than 10 meters.  How do they lift water to their tops?  UPDATE  In other words: how cohesion-tension theory can be true if it apparently contradicts the laws of physics?   UPDATE 2  Atmospheric pressure helps to rise the water, not resists rising. What is resisting is water weight. When water column is 10 meters high, then atmospheric pressure can't help anymore.   Any adhesion/cohesion mechanism can't help here too, because it acts only in thin molecular layer. To transfer action force further the pressure is required, which is insufficient at 10 meters.  UPDATE 3  If we had capillary small enough to rise water to 10 meters and then we will build smaller capillary which we expect will rise water higher, we will fail. Water column will break and does not climb higher than 10 meters.     Menisci acts like small piston and can't help rising water higher than 10 meters.  UPDATE 4  Common pressure distribution in capillary is follows:    $P_0$ is atmospheric pressure. As you see, right under menisci, the pressure is lowered by $2 \sigma / R$ where $R$ is the radius of menisci and $\sigma$ is surface tension. The entire term is called "Laplace pressure". As you see, it can't supersede atmospheric pressure, because water continuity will be broken in the case.  I.e. no any menisci can rise water higher than 10 meters.  The existence of higher trees PROVES that there are some other significant mechanisms, not adhesion/cohesion, not capillary.  UPDATE 5  Current version, as I understood it, is based on a declaration, that a water, if put into thin capillary, can behave like a solid body. Particularly, it can resist tension up to minus 15 atmospheres.   This is a tensile strength of concrete, so I don't believe that without additional proofs.  I think it is just not hard to make thin tube, put water into it and check, how high it can climb.  Was it done ever? Single Variable Calculus Reference Recommendations This question is a  of the common question asking for calculus references. It is here to  away the repetition, and give a canonical resource for calculus references.      I'm looking for a resources to learn single-variable calculus. How to prove that $\lim\limits_{x\to0}\frac{\sin x}x=1$? How can one prove the statement $$\lim_{x\to 0}\frac{\sin x}x=1$$ without using the Taylor series of $\sin$, $\cos$ and $\tan$? Best would be a geometrical solution.  This is homework. In my math class, we are about to prove that $\sin$ is continuous. We found out, that proving the above statement is enough for proving the continuity of $\sin$, but I can't find out how. Any help is appreciated. How to call a function in a Twig file Is there any bidirectional 5v-3.3v level shifter? Is there any IC that interfaces any 3.3V Input/Output to 5V Output/Input? I need it primarily for an Arduino Due but if there any bidirectional IC that works like that it would be great.  Some people advised me to use the SN74AHC125 and CD4050 ICs, but I don't understand how they work or how to interface with them.