So it seems that my java program is not able to recognize two identical objects even though I'm using the same method as in a previous question where java did recognize the two objects as being the same. The only difference in this program is I have an extra keyboard.nextLine() which is necessary for inputting the name/address of object two.  Here's the class input      public boolean equals(Person num1) {     if ((this.name==num1.name)&amp;&amp;(this.address==num1.address)&amp;&amp;     (this.age==num1.age)&amp;&amp;(this.phoneNumber==num1.phoneNumber))         return true;     else         return false; }   Here's the demo input     import java.util.Scanner;    public class PersonDemo {     public static void main(String[] args) {      Person num1, num2;     num1=new Person();     num2=new Person();      String name, address;     int age;      long phoneNumber;      Scanner keyboard = new Scanner(System.in);      System.out.println("Input the name of person 1:");     name=keyboard.nextLine();     System.out.println("Input the address of person 1:");     address=keyboard.nextLine();     System.out.println("Input the age of person 1:");     age=keyboard.nextInt();     System.out.println("Input the phone number of person 1:");     phoneNumber=keyboard.nextLong();     keyboard.nextLine();      num1.setName(name);     num1.setAddress(address);     num1.setAge(age);     num1.setPhoneNumber(phoneNumber);      System.out.println("\nInformation of person 1: ");     System.out.println(num1);      System.out.println("\nInput the name of person 2:");     name=keyboard.nextLine();     System.out.println("Input the address of person 2:");     address=keyboard.nextLine();     System.out.println("Input the age of person 2:");     age=keyboard.nextInt();     System.out.println("Input the phone number of person 2:");     phoneNumber=keyboard.nextLong();      num2.setName(name);     num2.setAddress(address);     num2.setAge(age);     num2.setPhoneNumber(phoneNumber);      System.out.println("\nInformation of person 2: ");     System.out.println(num2);      if (num1.equals(num2))         System.out.println("\nPerson 1 and person 2 are identical.");     else          System.out.println("\nPerson 1 and person 2 are not identical."); }      }
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?
How do I rename a domain and preserve SEO? As part of graduating from Area51 and becoming a full fledged site we sometimes change domain names from http://topic.stackexchange.com to http://example.com. Aside from the obvious 301 redirect rules to support existing urls transparently, are there other techniques that would aid in the preservation of SEO? Bottom to top explanation of the Mahalanobis distance? How do Idle games progress while not active? Need a matrix to seventh power which is the identity but the original is not or the negative identity The question on the homework wants a $2\times2$ matrix $R$, but $R$ not equal to positive or negative identity, that when you raise to seventh power you get the identity.  $R^7=\operatorname{Id}$.  I thought it would have to be some ones and negative ones,  it no luck, then tried some ones and some $.5$.  Just using an online matrix calculator to do brute force.  We just started talking about eigenvalues with visual example, so assuming wouldn't need that since we have not talked about how to find them yet.  Any hints or ideas to get me back on track? How can I format a date as dd/mm/yyyy or mm/dd/yy ?   Like in VB format("dd/mm/yy",now)  How can I do this in C#? Does a man contain all the genes needed to make a woman? This question is brought on by a Sci Fi novel I am thinking about writing. The plot device involves a colonist in charge of building a population on a new planet who loses his supply of embryos and so forth in the landing. With the artificial "wombs" intact, he populates the planet with clones of himself.  If he wanted to introduce enough variation (without making up new genes, only rearranging) in the population to allow them to be able to reproduce naturally without inbreeding problems, would he be able to? In particular, could he make a woman?  Alternately, could a woman (without a Y chromosome) do the the inverse?  At the risk of introducing bias into the answers, the plot as it stands assumes he is a male and he CAN'T do any of the above and he is restricted to clones. Why is no root pass needed to access MariaDB after upgrade to Ubuntu 16.04? Chatroom owners can star their own messages I was able to star my own message by pinning it and unpinning it.  Pinning a message adds a star, even to your own messages, but when the pin is removed, the star remains. Problem numbering environment Solving $ax \equiv c \pmod b$ efficiently when $a,b$ are not coprime I know how to compute modular multiplicative inverses for co-prime variables $a$ and $b$, but is there an efficient method for computing variable $x$ where $x &lt; b$ and $a$ and $b$ are not co-prime, given variables $a$, $b$ and $c$, as described by the equation below?   $ a x \equiv c \mod b $   For example, given  $ 154x \equiv 14 \mod 182 $, is there an efficient method for computing all the possibilities of $x$, without pure bruteforce?  Please note that I'm not necessarily asking for a direct solution, just a more optimized one.    I do not believe that the Extended Euclidean Algorithm will work here, because $a$ and $b$ are not co-prime.   Edit:  Follow up question, since the first one had a shortcut:  Could the be computed efficiently as well?  $12260x \equiv 24560 \mod 24755$.  $107$ needs to be one of the computed answers. I'm trying to recall the name of a book I read, probably published after 1990, where alien AI infects satellites and a barrier is established, isolating earth from space that maybe slows down time inside of it, relative to the passage of time outside.  Mars or the moon is also colonized in an attempt to flee the now real possibility that the sun will become a red giant and wipe out humanity in the not-too-distant future (as perceived on earth), but the colony gets one of the time barriers as well.  I think the name of the novel was short, "The _______" (one word).  The story focused more on the human cost and followed one particular family, one member of which was somehow also partially infected by the alien AI, but I don't remember as much about them. Subsetting matrices Bash tab completion fails inside of command substitution I've been using kill $(pidof ) to terminate programs for a while, and since last night, every time I try to use tab completion inside the $() it throws an error,   bash: unexpected EOF while looking for matching `)' bash: syntax error: unexpected end of file   Tab-completion works fine outside of command substitution.  I guess my question is where are the configuration files for tab-completion located on an Ubuntu system? If anyone has had this specific problem, or can see plainly what I cannot, how to fix this, and/or why this would occur? (I always want to know why.)  and if not that, even where and how I should begin my investigation into this problem, would be greatly appreciated.  UPDATE  tab completion following $(pidof is no longer throwing an error, but is now not working at all. I've never really messed with any bash internals before, but am not afraid to get my hands dirty. Any guidance greatly appreciated. How to check if this limit exists: $$\lim_{(x,y)\rightarrow (0,0)}{ \frac{x^4y^4}{(x^2 + y^4)^3}}$$  Can I convert it to polar form ? $$\frac{r^8 (\cos^4 (\theta)\sin^4(\theta)}{r^6 (\cos^6 (\theta) + r^6 \sin^{12} (\theta))} = \frac{r^2}{\cos^6(\theta) + 0} = 0$$ How to evaluate $ \lim \limits_{n\to \infty} \sum \limits_ {k=1}^n \frac{k^n}{n^n}$? I can show that the following limit exists but I am having difficulties to find it. It is $$\lim_{n\to \infty} \sum_{k=1}^n \frac{k^n}{n^n}$$ Can someone please help me? I am sure this question has been asked in some capacity on this site. I am a first year graduate student. I was contracted for a summer program that would have looked very good on my CV about 6 weeks ago.   However, due to the spread of COVID-19 the program was cancelled. Is there any way I can express this on my CV (possibly have an asterisk next to this activity)? If not, how should I explain the situation when applying for positions next year (because, now it is unlikely I will have anything noteworthy to put on my CV for this summer).  Thank you What the #$@&%*! is that called? Is there a name for the use of symbols in place of curse words, for example #$@&amp;%*!? Understanding imaginary exponents If I read the sentence     Find ten apples and oranges.   Do I need to find ten or twenty pieces of fruit? Why do diamonds shine?