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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:46:30+00:00 2026-06-18T05:46:30+00:00

Ok, so I have been reading every google result about creating an array of

  • 0

Ok, so I have been reading every google result about creating an array of linkedlist, and most of the stack overflow threads, but I don’t really understand what they are doing. Do I need to create a seperate class that extends linkedlist and then create an array of that class?

I have tried a million different ways of arranging this code, but this is what I have at the moment.

public static int[][] genPerms(int numElements, int totPerms) {
    int permArray[][] = new int[totPerms][numElements];
    LinkedList<Integer>[] elementsLeftList = new LinkedList<Integer>[numElements];

The error is generic array creation. Can someone explain to me what is actually going on here.

In addition to the solutions below I was told you can create an array of head pointers.

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-18T05:46:31+00:00Added an answer on June 18, 2026 at 5:46 am

    You can’t currently create an array of generics in Java without going through a complicated process. Can you do the following instead?

    List<LinkedList<Integer>> elementsLeftList = new ArrayList<LinkedList<Integer>>();
    

    If you really need it as an array you can then get it from elementsLeftList.toArray() and cast the result.

    You can read the following link for the explanation: http://www.angelikalanger.com/GenericsFAQ/FAQSections/ParameterizedTypes.html#FAQ104

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

Sidebar

Related Questions

I have been reading about making ajax heavy applications more search engine friendly: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
I have been reading a lot about Ruby the past few days. Every SO
I have been reading a LOT of google posts and StackOverflow questions about how
i have been reading about proximity security devices through bluetooth, but i am wondering
I've been reading about inheritance but I still dont have it 100% clear, here
Ok this is my first post on Stack Overflow I have been reading for
i have been reading this interesting article which is increasing my every growing confusion
Have been reading about async and tasks and been attempting to convert the CopyFileEx
I have been reading conflicting information about the use of #define macros in iOS
I have been reading a lot about QR codes and how the code itself

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.