I'm learning Java and trying to make a small program.  I made a list and a while loop. Everytime the user inputs something it should save the input to the list. Only if the input is "0" then i want it to break the while loop and print out everything whats inside the list. So it has to keep asking the user for an input till he insert 0. At the moment i don't have a teacher. I'm doing this all on my own. Don't blame me for my bad writting skills...  import java.util.ArrayList; import java.util.Scanner;  public class demo {     public static void main(String[] args) {         while (true) {              ArrayList nummer = new ArrayList(); // make new list              Scanner input = new Scanner(System.in); // start scanner              System.out.print("Voer uw naam in: ");              String naam = input.nextLine(); // scanner waiting for input + enter             if (naam == "0") {                 System.out.println("Wrong, exit!");                 input.close();                  for (Object item : nummer) { // foreach-loop                      System.out.print(item);                      }                 break;             } else {                  nummer.add(naam);                 continue;             }         }     } }   Could someone take a look to it and tell me what's wrong with it?  Thanks!
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?
Good tools for drawing schematics I was going to add a bit of information to my post on a previous day using schematics and some instructions. What programs are being employed for this purpose?  I mostly want to see what others are using and that I can easily use to give descriptive schematics.  In a perfect world, and I know this is a case of me wishing, it would be:   Free. Extremely easy to draw schematics in. Allows simple production of waveforms for the inputs/outputs. What is the process for a moderator to request reinstatement or appeal a removal? Please leave any feedback or questions about this process on .   From time to time, moderators will step down or be removed from their positions — they may have expressed their wish to step down due to time constraints or they may have had behaviors unfitting of a moderator and have been forcefully removed, along with a number of other possibilities that fall somewhere between those two. What is the process for evaluating moderator reinstatement or removal appeal requests?  Note: Feedback on the original version of this post can still be found . I thought this would be a simple question, but I'm having trouble figuring it out. Not a homework assignment btw. I am a physics student and am just genuinely interested in physics problems involving math, which would be all of them.  So lets say we drop an object from a height, $R+r$, it falls toward earth. This height, $R+r$, is far enough away that the $g$ it experiences is a fraction of $g$ at sea-level. Let's just say that air resistance is negligible, and it wouldn't be that complicated to just integrate from $0$ velocity to the terminal velocity piece wise and deal with the rest of it later.  So the key here is that acceleration is changing with time. I thought I could simplify this by saying it changes with distance, and it has nothing to do with time, but this didn't really help, my guess is that maybe time is important (doh).  I tried integrating acceleration with time, and ended up nowhere. I tried integrating $a=GM/R^2$ with respect to $R$ from $R+r$ to $R$ and ended up with a negative function.  I saw somewhere someone tried to expand with taylor series, they even have something similar on hyperphysics, but I can't figure out how to obtain the polynomials that precede the variables.    This is the hyperphysics site where they use polynomials to find the distance.   Maybe I can't solve this because I haven't taken a course in differential equations yet. What I want to know is how to calculate the distance at any time. What does it mean to accept an answer? How do I accept an answer, and what are the rules? Can I accept my own self-answer? What are the reputation benefits? Which answer should I accept? Should I upvote the accepted answer? What should I do if none of the answers are suitable?      For more information, see "" in the . Which words in a title should be capitalized? Are there any concrete rules that say which words (parts of speech) in a title should start with a capital letter? What would be a correct capitalization for the title of this question? I want to show that for $S,T\in B(H)$ bounded operators on Hilbertspace with $S\geq 0,T\geq 0$ and $ST=TS$,  we have $S+T\geq 0$, and $ST\geq 0$.  $T\geq 0$ means $(Tx,x)\geq 0$.    To me it seems that $((S+T)x,x) = (Sx,x)+(Tx,x)\geq 0$. But for $ST$ i like some help.   There is a theorem in Rudin (12.32) that says that for every $T\in B(H)$ we have an equivalence:   $T$ is positive $\Leftrightarrow$ $T$ is self adjoint, i.e. $T=T^*$ and $\sigma(T)\subset [0,\infty)$.   Since $S, T$ are self adjoint we know that $ST=TS = S^*T^* = T^*S^*$ ($ST$ is selfadjoint since $S,T$ commute). Also I read somewhere that if $S,T $ commute then $\sigma(ST)\subset \sigma(S)\sigma(T)$, but I am not sure if this is true. Clearly I cant prove it, but if it were true by this ''Theorem'' it would follow that $ST \geq 0$.   Is there a more straightforward way? Switch statement fall-through...should it be allowed? I want to argue that argue that $\pi(\alpha)=\alpha^3+3\alpha+3$ is an irreducible polynomial over the finite field with 5 elements $\mathbb{F}_5$. My approach was just to check that $\pi$ has no roots in $\mathbb{F}_5$. Is this right? Order of items in a context menu How do I get the coordinates of a mouse click on a canvas element? What's the simplest way to add a click event handler to a canvas element that will return the x and y coordinates of the click (relative to the canvas element)?  No legacy browser compatibility required, Safari, Opera and Firefox will do. Where does $PATH get set in OS X 10.6 Snow Leopard? I type echo $PATH on the command line and get  /opt/local/bin:/opt/local/sbin:/Users/andrew/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/pear/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin  I'm wondering where this is getting set since my .bash_login file is empty.  I'm particularly concerned that, after installing MacPorts, it installed a bunch of junk in /opt. I don't think that directory even exists in a normal Mac OS X install.  Update: Thanks to  for correcting my echo $PATH statement Where can I send feature requests? Both for Ubuntu as a whole and individual (supported) apps? Let $a,b,m,n$ be positive integers such that g.c.d.$(a,b)=1$ and $a^m+b^m|a^n+b^n$ , then is it true that $m$ divides $n$ ? Prove that $A \smallsetminus (A \smallsetminus B) = A \cap B$ $A$ and $B$ are any sets, prove that $A \smallsetminus (A \smallsetminus B) = A \cap B.$ This formula makes sense when represented on a Venn diagram, but I am having trouble with proving it mathematically.  I have tried letting $x$ be an element of $A$ and continue from there, but it doesn't seem to work out as a valid proof anyways.   Could anyone please point me in the right direction?  Many thanks. For any two sets $A,B$ , $|A|\leq|B|$ or $|B|\leq|A|$ Let $A,B$ be any two sets. I really think that the statement $|A|\leq|B|$ or $|B|\leq|A|$ is true. Formally:     $$\forall A\forall B[\,|A|\leq|B| \lor\ |B|\leq|A|\,]$$   If this statement is true, what is the proof ? shortcut for commands How do I use an NBT editor to modify item properties? In Minecraft, the NBT (Named Binary Tag) format is used to store data of our Minecraft worlds, including block, entity, and item properties. In the Java Edition of Minecraft, you can modify this data by including the data in the command, like so: /give @s diamond_sword{Enchantments:[{id:&quot;minecraft:knockback&quot;,lvl:10s}]}  In the Bedrock Edition, on the other hand, NBT is inaccessible from commands. In order to modify NBT, we need to use an external editor. What are some useful item properties that I can modify with an NBT editor, and how can I do so?  Related: I have an Ubuntu machine that I'm using as my home Internet router.  It uses a USB mobile broadband modem as its Internet connection, and shares this with another router (via the router's "Internet" port) which I use as my LAN.  How do I redirect requests from within my LAN for a given URL to a custom IP address (ex have google.com redirect to x.x.x.x)? All nilpotent $2 \times 2$ matrices satisfy $A^{2}=0$ The  specifically says not to ask  for career advice but people do it anyway.  Should I consider the Help Center outdated or only loosely enforced?    And what about a career advice site on the network?  There are 70+ sites, and most of them are for relatively narrow interests (which is not a criticism, I enjoy looking through the many sections).  A career section seems like it would be very popular.  Also, a careers section would help keep career questions off the other sites.