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 9023045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:40:03+00:00 2026-06-16T05:40:03+00:00

I have the following in my top class working like a charm: public class

  • 0

I have the following in my top class working like a charm:

public class TestA<E extends Test>
{
      List<Vector<E>> list;
      String name, location;

      TestA(String name, String location)
      {
            this.name = name;
            this.location = location;
            list = new ArrayList<Vector<E>>();
      }

      void populate(Test[] arr)
      {
            for(Vector<E> vk : list)
            {
                  // Code here...
            }
      }

}     

class OrderedTest<E extends Test> extends TestA {

      OrderedTest(String name, String location)
      {
            super(name, location);
      }

      void populate(Test[] arr)
      {
            for(Vector<E> vk : list) // ERROR: Cannot convert from element Object to Vector<E>
            {
                  // Code here... 
            }
      }

}

When i try to extend populate() in my subclass i basically want the same method only here i want things ordered so i will pull each Vector in a quicksort method but i dont get any other problems apart from: // ERROR: Cannot convert from element Object to

EDIT: Should i have to implement Iterator for TestA ?

  • 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-06-16T05:40:05+00:00Added an answer on June 16, 2026 at 5:40 am

    As coded, the two uses of “E” as a generic parameter are independent and disconnected. Vector<E> in one class does not mean the same as Vector<E> in the other.

    Change the subclass declaration to:

    class OrderedTest<E extends Test> extends TestA<E>
    

    and the E in the superclass declarations is the same E as in OrderedTest.

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

Sidebar

Related Questions

I have the following class structure class Top : NotifyPropertyChanged { private List<Inner> innerList;
I have the following menu: <ul class=top-menu> <li><a_href=/Products title=Products><span>Products</span></a><ul> <li><a_href=/Products/List title=Product List><span>Product List</span></a></li> </ul>
I have the following at the top of my document: <html class=js lang=en xml:lang=en
I have following HTML: <div class=olympics style=display: block; position: absolute; left: 250px; top: px;>
I have the following links at the top of my web page: <ul class=icyLink>
Hy i have the following code : import java.sql.*; import java.net.*; public class binsz
I have following SQL query SELECT TOP 10000 AVG(DailyNodeAvailability.Availability) AS AVERAGE_of_Availability FROM Nodes INNER
I have the following query: select top 100 eid, cid, id, position, ROW_NUMBER() over(order
I have following CSS: table tbody tr:last-child td { padding-top: 7px; border-bottom: 0; }
I have the following jquery script: $(function(){ $('#top-menu').on('click', 'a.change-menu', function(e){ e.preventDefault() $(#menu-change-div).load($(this).attr(href)); }); });

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.