Difference Between equals() method and == Operator In java | Techky Talk In java language it is a very important question to learn. It is asked in so many interviews and so many placements test. Both equals() and "==" operator in Java is used to compare objects to check equality but main difference between equals method and == operator is that former is method and later is operator. Since Java doesn’t support operator overloading, == behaves identical for every object but equals() is method, which can be overridden in Java and logic to compare objects can be changed based upon business rules. In java equals() is a method and == is an operator.equals(): equals() method is used check whether the two object have the same value or not.==: This operator is simply used to check whether two objects having the same reference means Whether they are referring to the same memory location. Here is an Example to Understand This concept Easily: Source Code:
Writing java programs on a remote server - Carpe diem (Felix's blog) Recently I started to work on hadoop and big data processing, but I was frustrated on eclipse and the development environment. We run hadoop on a remote cluster, but develop map-reduce programs on laptop. The development cycle was pretty slow because we need to upload the jar for every release. Another thing is Eclipse is too inefficient for a Vim and Emacs hacker like me. Thankfully I’m not the only one who think this way; Eric Van Dewoestine developed Eclim which can let you work on java programs on headless eclipse and vim/emacs! Install Eclipse I thought it wasn’t that difficult to install the Eclim on remote server, but actually it’s not that trivial to do. To install eclipse, follow the links on it’s official website, and click linux download link to get the actual url. Extract the tar-ball somewhere in your home directory. Other dependencies Although we want to run Eclim in CLI environment, we still need X11 to run Eclipse daemon. Install Eclim Starting Eclim
What Java Collection should I use? Tail Recursion In Clojure | 8th Light The ability of lisp programs to manipulate themselves is beautiful. When we take into account the amount of the language that is implemeneted by manipulating itself, it becomes even more interesting. As a user of the language we also have the power to extend the language in interesting ways. I recently paired with Colin Jones on one such language extension. Immutable Iteration One hurdle to overcome when switching from mutable to immutable languages is coming to terms with the fact that many of the statements in your programming toolbelt are no longer valid. void doSomething() { boolean isDone = false; while (! The issue here is that mutating isDone inside of the loop is not allowed. void doSomething() { doSomething(false);} void doSomething(boolean isDone) { if (! Now, instead of mutating isDone there is a fresh value of isDone on each invocation of the function doSomething. Tail Call Optimization There are two pieces of state that we'll need to keep. And then we can add the loop[1]. 1.