Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7025879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:02:32+00:00 2026-05-28T00:02:32+00:00

I have my own custom LinkedList class that has a pointer to the first

  • 0

I have my own custom LinkedList class that has a pointer to the first Node in the list. I now need to create a DoublyLinkedList class. The only difference between the DoublyLinkedList and the LinkedList is that the DoublyLinkedList uses DoubleNodes instead of Nodes. My DoubleNode class extends the Node class.

What is the correct way create a DoublyLinkedList that extends LinkedList?

Would have have to constantly cast DoubleNodes to Nodes? Or is there a simpler way that I’m just missing?

Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:02:33+00:00Added an answer on May 28, 2026 at 12:02 am

    Well I managed to figure this out on my own.

    As it turns out, the only method that needs to change for DoublyLinkedList is the add method. Here’s my DoublyLinkedList add method:

    public void add(Object obj){
            DoubleNode newNode = new DoubleNode(obj);
            newNode.setPrev(getLast());
            super.add((Node)newNode);
        }
    

    By creating a new DoubleNode and then casting it to a Node, I am able to keep most methods the same. If I need to access the DoubleNode’s prev pointer, I can downcast the Node as needed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need your help. I have write my own custom NSOperation class called GetNewsOperation.
I have my own custom Content Provider that loads a database which contains the
I have created my own custom role provider class SGI_RoleProvider and configured properly. Everything
i have installed my own custom Windows Service. I need to find out the
I have my own custom configuration sections but would like to create a new
I have my own custom UI that renders email. but it renders only text
I have created my own custom ValidationAttribute : public class UrlValidationAttribute : ValidationAttribute {
I have created my own custom workflow (for now this is just adhoc workflow
We have our own custom calendar in our portal which is developed in Java.
I have my own custom tool for Visual Studio 2008 SP1. It consists of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.