Solved

Overriding Abstract methods...

Posted on 2004-09-28
6
268 Views
Last Modified: 2010-03-31
When I compile my code, I get the following error message:
myClass is not abstract and does not override abstract method clear( ) in java.util.Collection

Part of the code does override 3 methods from java.util.Collection, which cant be changed (part of the project), and I cant make this class abstract

My underlying questions are: Do I have to override all of the methods from Collection, or is there some way around this issue?
And if I have to override them all, does that really mean I have to rewrite the whole method, or is there a shortcut to that, assuming I dont need to use those methods?
0
Comment
Question by:jamescd23
  • 2
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 12175535
> Do I have to override all of the methods from Collection,

yes

> or is there some way around this issue?

declare class abstract
0
 
LVL 92

Expert Comment

by:objects
ID: 12175541
> And if I have to override them all, does that really mean I have to rewrite the whole method, or is there a shortcut to that, assuming I dont need to use those methods?

just make them empy methods if they are not needed
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 12175543
>>Do I have to override all of the methods from Collection

Yes, if you're implementing Collection
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 12175554
Why do you *need* to implement Collection? Why not extend a Collection implementation?
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now