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

  • Home
  • SEARCH
  • 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 8832141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:27:49+00:00 2026-06-14T08:27:49+00:00

Is it possible to take objects like a Vector and make it have multiple

  • 0

Is it possible to take objects like a Vector and make it have multiple generics? I know it’s possible when you create a class, but will other classes that come with the normal Java API (like Vectors, Stack, etc.) can have multiple generics?

For example:

Vector<String, Integer> vect = new Vector<String, Integer>();
vect.add("Hello!", 0);

From this, one index would have two values, a String and Integer.

Thanks in advance!!

  • 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-14T08:27:50+00:00Added an answer on June 14, 2026 at 8:27 am

    The Vector class implements a growable array of objects, I think you are looking for map, java.util.Map<key,value>, implementation of map is HashMap<k,v>

    Map<Integer,String> map = new HashMap<Integer,String>();
    map.put(1,"str");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several objects that look like this: class PhoneNumber { String getNumber(); String
Possible Duplicate: Constructors in Javascript objects im trying to learn how to create class's
In C we have Sockets and descriptors, it is possible to just take one
is it possible in Db4o to load new objects into persistent IObjectContainer? I have
I don't know if this is possible, but in some of my unit tests,
I'd like to take advantage of .NET's data frameworks, but I'm a bit confused
Please take a look at my class structure. I think I would like to
I was wondering if it is possible to map multiple DTO objects to a
I have these objects: Public Class MakeInfo Public Property Name As String Public Property
When inheriting from two objects like these class Foo(object): def __init__(self,a): self.a=a class Bar(object):

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.