Java List interface

25 pts.
Tags:
Java
Solving this query is indispensable to me proceeding further in Java. If we declare a List interface as List a = new arraylist(). By this a can access all the methods that are defined in the list interface.. You can also declare an arraylist a = new arraylist(). Now arraylist is a class which implicitly implements list. Java postulates state that if an interface is extended/implemented by another class all its methods have to be implemented. How is it that whilst using arraylist some methods in the list interface are left unimplemented... Please get back to me
ASKED: January 7, 2014  7:19 PM
UPDATED: January 8, 2014  4:43 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    Just curious:  Why is it indispensable for you to proceed further in Java?

    OTOH, which List's methods are not implemented in ArrayList?
    65,110 pointsBadges:
    report
  • nikhil1990
    dude are you lolling around or do you have an answer to my question. Whenever a class implements an interface all the interface's methods have to be implemented in the class but I don\t think this is so with arraylist. If one implements add what about the remove method. I mean to say in a single program not all methods are implemented
    25 pointsBadges:
    report
  • carlosdl
    Well, since your question is incomplete and shows a poor research effort on your part, I needed to ask a question to try to understand your doubt and provide an accurate answer, but since you apparently don't value the time others spend in trying to HELP YOU, I will proceed now to do the easiest thing to do: ignore this post.

    The question about the List's methods you think are not implemented in ArrayList was simple, wasn't it?
    65,110 pointsBadges:
    report
  • nikhil1990

    listen man anyone in my place would have construed your first sentence as frivolous. Please empathise with me I have an exam the day which centres around this. Please apologise if you took offense at my reply and try to help me

    25 pointsBadges:
    report
  • carlosdl
    Okay, the fact that I'm writing this shows that I didn't really ignore the post :)

    Let's focus on the subject of your question now:

    I don't think that any method from the List interface is left unimplemented in the ArrayList class.  Do you have a specific example of a method that is not implemented?

    Also, this part confuses me a bit:

    "If one implements add what about the remove method. I mean to say in a single program not all methods are implemented",

    because you were originally talking about the ArrayList class, and now you seem to be talking about implementing the List interface in a program written by you.  Could  you please clarify what you meant here?
    65,110 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following