I am having issues with a class project, one part of it specifically.   this is what the assignment says Write a program that manages a list of up to 10 players and their high scores in the computer's memory - do not write to the disk. Use one array of Player objects. The Player class should store the players name and score, with suitable constructors, accessors, and mutators. The Player class should also override the equals and toString methods appropriately. Your high score program should support the following features: - add a new player and score - print all of the players' names and their scores to the screen - allow the user to enter a player's name and output that player's score or a message if that player's name has not been entered - allow the user to enter a player's name and remove the player from the list  Create a menu system that allows the user to select which option to invoke.  So far I have been able to create a menu, add a player and a score, and print all of the players added. The issue I am having is searching the array for a specific name and then being able to remove that player.  below is a snippet from my handler class that handles the information.      public void removePlayer(String playerName)     {         //remove player from player array         //it doesn't work and I do not know how to get it to work         //the issue I have is I dont know how to compare a string to         //an array of players it doesnt compile correctly         //with the error "Incompatible Operand types players and String".          for (int i = 0; i&lt; players.length; i++)         {             if(this.players[i] == playerName)             {                 for (int x = i; x&lt;players.length; x++)                 {                     this.players[x] = this.players[x+1];                 }             }         }     }   I understand this is wrong but I do not know what to do to make it correct. here is the players class that takes in the info.  public class players {     private String playerName;     private int playerScore;      public players(){      }     public players(String newName, int newScore){         playerName = newName;         playerScore = newScore;      }        @Override     public boolean equals(Object otherPlayer){         return false;     }     @Override     public String toString(){         return playerName + " " + playerScore;     }  }   and lastly the handler code for the array. and how it adds players.  public class highScoreHandler {     private final static int PLAYER_LIMIT=10;     private players[] players;     private int pointer;       public highScoreHandler(){      this.players = new players[PLAYER_LIMIT];      for (int i = 0; i&lt; players.length; i++)     {         this.players[i] = new players();     }      this.pointer = 0;  }      public boolean addPlayer(players newPlayer)     {         //add new player to player array         if(this.pointer &gt; this.players.length-1)         {             System.out.println("please remove a player.");             return false;         }            else         {             this.players[this.pointer] = newPlayer;             this.pointer +=1;             System.out.println("Player has been added!");             return true;             }      }   any help would be greatly appreciated, thank you.
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?
I was wondering if there is a simpler way to find the last to digits of a power such as $3^{45}$. I reduced it modulo 100 to get the answer, which is 43. But I was curious if there was a simpler, or more eloquent way to get this result.  Here's my method:  Using the fact that $3^4=81\equiv -19 \pmod{100}$ and $19^5=2,476,099\equiv -1 \pmod{100}$  $$ 3^{45}\equiv 3(3^4)^{11}\equiv 3(-19)^{11}\equiv 3(-19)(19^5)^2\equiv 3(-19)(-1)^2 \equiv -57 \equiv 43 \pmod {100} $$  I just felt like this was sort of a messy way to find out that the last two digits are 43. What are the most important things I need to do to encourage Google Sitelinks? If $\gcd(a,b)=1$, $\gcd(a,y)=1$ and $\gcd(b,x)=1$ then prove that $ax+by$ is prime to $ab$.  I tried assuming Diophantine Equations for all the relations and representing everything in terms of $a$, but that didn't lead me anywhere. There must be an intuitive and elegant approach right? How do I kill mobs using /kill without them dropping loot? I have a spawn area I am hoping to make a safe haven, so I have a command block on a clock that kills each hostile mob type. This works to keep the place free of any hostile mobs, however every night I see rotten flesh, bones, arrows, and string everywhere.  I would like to add something to my command blocks so that they are killed without dropping loot. How can I accomplish this?  Note that I want mobs to drop loot generally elsewhere in the world, so /gamerule doMobLoot false will not do the trick for me. I'm hoping for a command that only applies to the mobs killed by the command block, and not anything else. Let $R$ be a finite ring with unity. Prove that every nonzero element of $R$ is either a unit or a zero-divisor. How to find the number of anti-symmetric relations? How do I cure Sanguinare Vampiris? I have Sanguinare Vampiris. I don't really want to become a vampire. How can I cure myself? Equation numbering problems in AMSMath environments with \pause I have the following problem: two groups A and B.  The proportions of married and single are ($p_1$) and ($p_2$) respectively, and the standard deviations ($s_1$) and ($s_2$). The sample consists of  ($n_1$) A and  ($n_2$) B observations.  Now I want to test whether the proportions are equal. I use the following formula to compute the z-statistic:  z = $abs(p_1 - p_2) / \sqrt{ \frac{p_1(1-p_1)}{n_1} + \frac{p_2(1-p_2)}{n_2} }$  and test the hypothesis: h0: $p_1 \neq p_2$  An alternative approach I tried is to estimate the t-value based on the standard deviations (hence just comparing means), that is by the formula (assuming unequal variances):  t = $abs(p_1-p_2)/\sqrt{ s_1^2/n_1 + s_2^2/n_2 }$  My question are:    do you agree with my approach or; should it be two-sided or one-sided?   Thank you. Tabs in Chrome Browser shrink too much How do I update my TeX distribution? I'm trying to compile a document that only works with an up-to-date distribution, so I'd like to know: how do I update my distribution? Please provide screenshots where appropriate.  List of answers           To keep an eye on what’s going on at CTAN you may subscribe to the  or the RSS feed feed://www.mail-archive.com/ctan-ann@dante.de/maillist.xml Time limit on accepting an answer Why is there a 15 minute time limit on accepting an answer in StackOverflow? Overriding "+=" in Python? (__iadd__() method) Is it possible to change the linkage of Nether portals? Recently I saw a widget on the Stack Overflow website which says Stack&nbsp;Overflow now has its own currency called "unicoins". According to this widget, a user can earn reputation, customize Stack Overflow by changing its colors and the user can also remove the vote down button from their questions and answers by spending "unicoins".  This widget does not look real, because this is out of standard of the Stack Overflow website.  Also today is 1st April. Is Stack Overflow fooling us?  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Why do the less than symbol () appear wrong as upside down exclamation (¡) or question mark (¿)? When typing &lt; or &gt; in LaTeX and compiling with pdflatex, the less than and greater than symbols appear at upside down exclamation points. I'm not in math mode. A disk is stuck in my slot-loading Dell Studio Hybrid. How can I get it out? The slot-loading optical drive in my Dell Studio Hybrid has been acting up. Sometimes it works fine, sometimes it churns and makes some unpleasant sounds. Now I can't even get it to eject the disc that's in there.  Many drives have an "emergency eject" pinhole, but I don't see one here. How can I get the disc out? Date comparison : which date format? Something special about energy eigenstates when it comes to time evolution? A particle is subject to an infinite square well potential with  $$V(x)= \begin{cases}  0  &amp;   −a \lt x \lt a\\   \infty &amp;  \,\,\,\,\text{otherwise} \end{cases}$$  At a time $t=0$ its wavefunction is given by $$\psi(x, t=0)=\frac{1}{\sqrt{5a}}\cos\left(\frac{\pi x}{2a}\right)+\frac{2}{\sqrt{5a}}\sin\left(\frac{\pi x}{a}\right)$$       (a) What are the possible results of an energy measurement at $t = 0$, and with what probabilities?     Re-writing the terms in $\psi(x,t=0)$ as $$u_1(x)=a^{-1/2}\cos\left(\frac{\pi x}{2a}\right)\qquad \text{&amp;} \qquad u_2(x)=a^{-1/2}\sin\left(\frac{\pi x}{a}\right)$$ such that $$\psi(x,t=0)= \frac{1}{\sqrt{5}}u_1(x)+\frac{2}{\sqrt{5}}u_2(x)$$ with energies $$E_1=\frac{\hbar^2 \pi^2}{8ma^2}\qquad \text{&amp;} \qquad E_2=\frac{\hbar^2 \pi^2}{2ma^2}$$ and probabilities $$P(E_1)=\frac15 \qquad \text{&amp;} \qquad P(E_2)=\frac45$$       (b) If no measurement is performed, what is the wavefunction $\psi(x, t)$ at all times $t$? What are the possible energies and their probabilities if a measurement is first performed at time $t$?     At a time $t$ the wavefunction is given by $$\psi(x, t=0)=\frac{1}{\sqrt{5a}}\cos\left(\frac{\pi x}{2a}\right)\exp\left(\frac{-i E_1 t}{\hbar}\right)+\frac{2}{\sqrt{5a}}\sin\left(\frac{\pi x}{a}\right)\exp\left(\frac{-i E_2 t}{\hbar}\right)$$    The problem is that I cannot answer the second part of the question (b).    The answer states that:      Because the two terms are energy eigenstates, the relative probabilities do not change and are as in the previous part.     I have some questions about the above statement: why does an "energy eigenstate" mean that the probablities don't change with time? Or, put in another way, does a "momentum eigenstate" (for example) have constant relative probabilities when measured at any time?   The answer seems to be implying there is something special about energy eigenstates when it comes to time evolution. The eigenvalues of energy measurements don't seem to change regardless of how many times you measure them, and no matter how long you wait until you measure them. I'm not sure if this is the case, but could someone please explain why all quantum operators (except Hamiltonian) do not exhibit this behaviour. Date and Time only partially visible in Big Sur