Results 1 to 6 of 6
Thread: equals sign
- 10-04-2012, 02:59 AM #1
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
- 10-04-2012, 03:47 AM #2
Member
- Join Date
- Jan 2012
- Posts
- 49
- Rep Power
- 0
Re: equals sign
why not put that in to an IDE and test it?
- 10-04-2012, 04:01 AM #3
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: equals sign
I will test it once I finish all my methods in my class since my class implements an interface and I can't compile it right now until I have all the classes done...
was just wondering before hand so I could clean up my code some.
- 10-04-2012, 06:01 AM #4
Member
- Join Date
- Jan 2012
- Posts
- 49
- Rep Power
- 0
Re: equals sign
create a new file and compile it.
- 10-04-2012, 09:42 AM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Re: equals sign
No, they're not the same thing.
Proof: (without compiler) The first is a couple of straight forward assignments. It is clear what it does.
The second isn't clear. It even makes the author stop and wonder.
Therefore they aren't the same.
---
Of course, they may (or may not) do exactly the same thing. They may (or may not) be functionally equivalent and generate the same byte code. To figure that one out, Reeling has the right idea.
- 10-04-2012, 10:10 AM #6
Re: equals sign
Bad approach, and expecially so for a beginner. Make the habit of compiling every time you add a few lines. That way you don't end up with an overwhelming amount of compiler errors, and for the one or two you might experience, you know exactly where to look: the code you've just written.
If your problem is that an interface is yet to be implemented, you have some options to allow you to compile:
-- add an empty implementation, or one that throws UnsupportedOperationException
-- temporarily declare the class abstract
-- temporarily comment out the implements clause
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
Single Sign on
By iksaak in forum Advanced JavaReplies: 0Last Post: 07-06-2010, 08:36 AM -
the @sign
By dinosoep in forum New To JavaReplies: 2Last Post: 03-28-2010, 11:07 AM -
sign finder
By iPetey in forum New To JavaReplies: 6Last Post: 05-01-2009, 05:24 AM -
How To self sign applet
By Chintan Patel in forum Java AppletsReplies: 1Last Post: 03-16-2009, 02:31 PM -
name clash: equals(E) in and equals(java.lang.Object)
By AdRock in forum New To JavaReplies: 0Last Post: 01-25-2008, 11:13 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks