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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:04:33+00:00 2026-06-14T22:04:33+00:00

I need to initialize a like Map x<Apartment,Vector<Expense>> it allows me if I @override

  • 0

I need to initialize a like Map x<Apartment,Vector<Expense>> it allows me if I @override the Map methods

Description Resource    Path    Location    Type
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.isEmpty()   Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.size()  Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.keySet()    Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.remove(Object)  Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.entrySet()  Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.putAll(Map<? extends Apartment,? extends Vector<Expense>>)  Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.values()    Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.clear() Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.get(Object) Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.containsKey(Object) Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.containsValue(Object)   Repository.java /proj_individual/src/repo   line 12 Java Problem
The type new Map<Apartment,Vector<Expense>>(){} must implement the inherited abstract method Map<Apartment,Vector<Expense>>.put(Apartment, Vector<Expense>) Repository.java /proj_individual/src/repo   line 12 Java Problem

But I read on the internet that Map isn’t a interface, it is a class, am I doing it wrong, or this is the way it has to be done?

  • 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-14T22:04:34+00:00Added an answer on June 14, 2026 at 10:04 pm
    Map<Apartment, Vector<Expense>> map = new HashMap<Apartment, Vector<Expense>>();
    

    Map is an interface (as the javadoc says — javadoc should be your reference, rather than the Internet). You need to choose an implementation (HashMap being the most often used one, but there are other implementations, with other characteristics).

    You should also forget about Vector. It shouldn’t be used anymore. Use List as a type, and ArrayList as an implementation (there are also other List implementations, but ArrayList is almost always what you want):

    Map<Apartment, List<Expense>> map = new HashMap<Apartment, List<Expense>>();
    

    or simply

    Map<Apartment, List<Expense>> map = new HashMap<>();
    

    if you’re under Java 7.

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

Sidebar

Related Questions

In some languages, like php, you don't need to manually initialize each dimension of
I need to initialize a constant HashMap and would like to do it in
I need to create a collection of key/value pairs like this: map<const int, string[]>
I need to initialize few objects, it can take a while so I want
I'm writing a web application and need to initialize some parameters that I'm pulling
I am writing a program in C++ and I need to initialize an array
To initialize an int array with all zeros, do I need to use: int
me need your adwise: i've got 2 classes, in first I initialize the object
I have a class: class One def initialize; end end I need to create
I have intialized Hash map inside static block, I need to access the hashmap

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.