-
Doubt about Comparator interface implementation
When u implement a interface u should implement all it's methods.
But when we implement Comparator interface u can leave the equals()
method . where this method is implemented? (A Interface can't
implement it's method ...)
please Help me ...........
-
You don't have to implement all the methods of an interface (though you often should)
But when we implement Comparator interface u can leave the equals()
leave the equals() where? you mean leave it out? clarify what you're talking about.
-
The equals method is defined for the Object class, so every class you make in Java will use the inherited method if its not implemented in the class itself. If you only need the Comparator interface to facilitate sorting, then the equals method does not come into play.
eschew obfuscation
Similar Threads
-
By sunilbenjamin in forum .NET
Replies: 1
Last Post: 06-13-2005, 12:58 PM
-
Replies: 0
Last Post: 02-26-2003, 06:31 AM
-
By Jeroen Ritmeijer in forum Java
Replies: 0
Last Post: 09-03-2001, 04:12 AM
-
Replies: 0
Last Post: 01-16-2001, 12:21 AM
-
By Camilo Torres in forum VB Classic
Replies: 2
Last Post: 10-18-2000, 10:23 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks