Unable to use if else statement Currently working on a simple system. Where the if else statement does not affect anything.  Here's the code :  tollRate() {      JFrame a = new JFrame();     setTitle("Highway Toll Rates System");     setSize(600, 400); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setLayout(new GridLayout(5, 2));      p1.setLayout(new GridLayout(1, 2));     p1.add(L1);                                                  p1.add(t1);     p2.setLayout(new GridLayout(1, 2));     p2.add(L2);     p2.add(t2);     p3.setLayout(new GridLayout(1, 2));     p3.add(L3);     p3.add(t3);     p4.setLayout(new FlowLayout());     p4.add(b1);     p4.add(b2);     p5.setLayout(new FlowLayout());     p5.add(L4);     add(p1); add(p2); add(p3); add(p4); add(p5);      b1.addActionListener(this); b2.addActionListener(this); }  public void actionPerformed(ActionEvent a)  {     Object source = a.getSource();     if(source == b2)      {           this.dispose();     }      else if(source == b1)      {         i = t1.getText();         j = t2.getText();         k = t3.getText();          if (i!=SUNGAI BULOH)         {             JOptionPane.showMessageDialog(null, "Invalid Location" );         }         }         }   public static void main(String[] args)  {     tollRate a = new tollRate();  } }   Can anyone assist me with the if else statement in this code? I want the system to display "invalid location" if the user keys in anything other than "SUNGAI BULOH" in i.  Thank you in advance.
How do I compare strings in Java? 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 to match * with hidden files inside a directory How to match the hidden files inside the given directories   for example   If I give the below command it's not giving the result of the hidden files,     du -b maybehere*/*   how to achieve this simple using a single command instead of using   du -b maybehere*/.* maybehere*/*   as I need to type maybehere twice. I had this "almost bonus" question on the final in Group Theory recently: prove that there is no such group $G$ which would satisfy Aut$(G)\cong \mathbb{Z}_n$, where $n$ is an odd integer. I don't have much certainty if this proof is OK, and one's opinion would be appreciated.  Here's my attempt:     Suppose that there exists such a group $G$ that satisfies the above condition. Since $\mathbb{Z}_n$ is cyclic, Aut$(G)$ is also cyclic and $G$ is abelian, which implies that Inn$(G)\cong \{e\}$. Thus Aut$(G)=$Out$(G)$. (I don't think this fact is important here though). Now, since an automorphism sends a generator to a generator, and since each automorphism is completely determined by such mapping, |Aut($G$)| must be of factorial order. But an integer factorial is always even. However, $|\mathbb{Z}_n|$ is odd, which is a contradiction. Therefore, no such $G$ exists.   I'm afraid that my proof is not very nice, but at least a genuine attempt was made. How to obtain a confidence interval for a percentile? I have a bunch of raw data values that are dollar amounts and I want to find a confidence interval for a percentile of that data.  Is there a formula for such a confidence interval? How to prove that $z\gcd(a,b)=\gcd(za,zb)$ I need to prove that $z\gcd(a,b)=\gcd(za,zb)$.    I tried a lot, for example, looking at set of common divisors of the two sides, but I can't conclude anything from that. Can you please give me some advice how I can handle this problem? And $a,b,z \in \mathbb{Z}$. Recently I ran across the sentence:     "Just why the law prescribed thirty-nine lashes instead of forty or forty-one and so on, must needs remain unanswered."   How did a plural verb like "needs" wind up as an adverb?  Is it alone in this phenomenon, or are there other examples that appear to be an odd misplacement of a second verb, but are actually adverbs as well? Can anyone tell me how to judge if a supervised machine learning model is overfitting or not? If I don't have an external validation dataset, I want to know if I can use ROC of 10 fold cross validation to explain overfitting. If I have an external validation dataset, what should I do next? Can hypercomputation compute the impossible? There are things which are illogical/logically impossible (like saying that 2+2=4 and 2+2=5. Without changing anything in the axioms of mathematics or logic, this would be a contradiction and would be inconsistent and illogical/logically impossible.   There are other types of logic systems apart from classical logic, like paraconsistent logics or even trivialism, that allow these contradictions to occur, prove them as right and work with them.   We can make a paraconsistent or trivialist system and work with it. For example, with trivialism, in theory, we would be able to derive and state everything we would want (since literally everything, even including illogical/logically impossible inconsistencies and contradictions), but we as humans (or as brains), are limited and can't conceive everything we want (at least to what I know). Therefore, no matter how many trivialist models we create and how much time we would work with them, we would never find or conceive many illogical/logically things because they are just that: impossible. There are impossible things to describe and conceive. For example, Russel's set is the set of all sets that do not contain themselves. If Russel's set contains itself, then it cannot contain itself, since it only contains sets that don't contain themselves. But if Russel's set does not contain itself, then it must contain itself, since it contains all sets that don't contain themselves.  There are quite a few logic bombs like this. You cannot ever compute the contents of Russel's set, and there are more formal, mathematical ways to present it. All of them have in common that you can't actually compute what the set is, whether you do it by hand, in your head, or on a computer. It's just a statement that cannot be fully logically processed.  If you take every possible state the human brain can be in, none of them include the computation of Russel's Set's contents. That is, not only can the contents not be computed, they cannot even be represented. No stimulus can cause us to comprehend Russel's Set, since such comprehension is not possible to begin with. It does not have a solution. Even if we try to solve it using trivialism, we would just be able to write a solution that does not make sense and prove it has sense and it is the real solution, but we could not be able to have a solution that would make sense "outside" the realm of trivialism (for example in classical logic), even though, using trivialism, we could prove that such solution would have sense in whatever context and logic system.   But what about hypercomputational machines (for example oracle-like machines)? I've read about some models of hypercomputation which are compatible with paraconsistent or trivialism logics. I've also read there are some models of hypercomputation (particularly those oracle-like models which use a black box) where, essentially, the hypercomputer is an algorithm that cannot exist. It might be because such an algorithm is fundamentally forbidden by logic itself (which is hided in a black box). Would any of these be capable of computing/"conceiving" these impossible things I wrote before? Do you know of anything that would help? \ref, make figure/table reference automatically toggle between "above" or "below" Is it possible to automatically include a reference to the position of a labeled object (Table, Figure) in text? By this I mean the following:  Say I have labeled a figure in chapter 1:  \label{fig:one}   Then I refer to it in text by using:  See Figure~\ref{fig:one}   Which produces "See Figure 1.1" as desired. I'd like to be able to have it produce: "See Figure 1.1, above" or "See Figure 1.1, below", automatically detecting whether to produce "above" or "below" depending on whether the figure will be placed above that position on the final page. A quark star is a hypothetical type of compact exotic star composed of quark matter. These are ultra-dense phases of degenerate matter theorized to form inside particularly massive[citation needed] neutron stars. -Wikipedia   If you add enough mass to a neutron star it forms a black hole but how much mass is needed to form a quark star? When do neutrons and protons start to break down into a mush of quarks and gluons? Does the sequence $\{\sin^n(n)\}$ converge?   Does the series $\sum\limits_{n=1}^\infty \sin^n(n)$ converge? I started to work with EEVEE short time ago and I was amazed by the capabilities of this engine. However, I noticed something strange when I was rendering some tests. Some objects/reflections/shadows dissapear when they're off canvas. I imagine that maybe this is for save memory data, but it can be not suitable to some projects. To make my point graphical, I made a simple scene with simple objects. The main object is the sphere with a mirror-like shader. Out of focus there are different objects with different shaders. A yellow cone, a blue cylinder and a white cube light. But surprisingly, those objects dissapear when the composition is rendered. See the rendered animation below:  Notice that the blue cylinder is not even showing at all in the final render. And the blooming effect from the light cube also dies. I would like to improve this bahaviour and render the objects that are still out of canvas using EEVEE. Do I missing something like memory configuration or reflection/shadow tweaks? Is this caused by the EEVEE engine or by my GPU config (GTX1060)? Thank you in advance! Why does exclamation mark within double quotes cause a Bash error? Please look at these commands:  $ notify-send SYNC TIME! $ notify-send 'SYNC TIME!' $ notify-send "SYNC TIME!" bash: !": event not found $   The first two commands produce a notification bubble as expected. The third gives the error shown.  and  $ echo SYNC TIME! SYNC TIME! $ echo 'SYNC TIME!' SYNC TIME! $ echo "SYNC TIME!" bash: !": event not found $   Here as well, the echo works for first two commands but not in the third.  More problems here (although I was not planning on using this): both notify-send "SYNC!TIME" and echo "SYNC!TIME" give bash: !TIME": event not found.  But both notify-send and echo work with "SYNC! TIME"  Can someone please explain why the bash: !": event not found error appears? Is there a workaround to make CSS classes with names that start with numbers valid? Where should shell tools be installed? Are there Apple guidelines for where user shell tools in Mountain Lion should be installed? Some (e.g. TeX, or Apple's Git) end up in /usr, and others (e.g. X11) seem to end up in /opt (sometimes with a symlink from /usr), while others (e.g., Git) end up in /user/local, and I wonder what the difference is, and whether one is preferred over the other. Taking the second derivative of a parametric curve Why do damaged hard drives freeze the entire system? What is the integral of 0? How to run a fresh version of AIX in a Virtual Machine with a Linux host? Is there a word for someone who won't think critically? Is there a word for someone who won't think through issues and instead comes to others hoping that they will think for them and solve problems for them?  A word that is more specific to a lack of critical thinking skills than "lazy"? While proving a universal quantification, we begin by "Let ... in ..." or "Arbitrary choose ..."?