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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:18:06+00:00 2026-06-11T20:18:06+00:00

I have a multidimensional array which I don’t know how to call in a

  • 0

I have a multidimensional array which I don’t know how to “call” in a specific index.

Here is my code :

        List<String[]> stats = new ArrayList<>();
        stats.add(new String[11]);
        String currentDate = null;
        String nextDate = null;
        String prize = null;
        int j = 0;
        for(i = 1; i < statsFromFile.size(); i++) {
            currentDate = toStringDate(statsFromFile.get(i).get(0), date, sdf);
            nextDate = toStringDate(statsFromFile.get(i+1).get(0), date, sdf);
            prize = statsFromFile.get(i).get(1);
            stats.get(j)[0] = currentDate;
            if(currentDate.equals(nextDate)) {

                stats.get(j)[4]++; // Here's the problematic line.

            }
            else {
                stats.add(new String[11]);
                j++;
                prize = statsFromFile.get(j).get(0);

                stats.get(j)[1]++; // And here too.

            }
        }

Before, the array was a long-type array and it worked well, but now that is a String-type array, it seems to doesn’t work the same way.

I have this error : Type mismatch: cannot convert from String to int

  • 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-11T20:18:08+00:00Added an answer on June 11, 2026 at 8:18 pm

    Syntax is wrong on both lines:

    stats.get(j)[4]++;
    

    What do you expect the ++ to do in this case?

    stats.get(j)[4] is accessing the 4th Element on the j-array in our list, which is a string array and your calling a mathimatical operator on the 4th element which is a string.

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

Sidebar

Related Questions

I have a string which represents a multidimensional array in the format: [[A, a],
I have a multidimensional array which I am looping through using a foreach loop.
I have a function which sorts data in a multidimensional array, as shown below:
All, I have the following array and function, which will create a multidimensional array
hi i have multidimensional array in php i want to remove an index from
I have a multidimensional array, here: $noticeDate = json_encode( $noticesDates ); and I want
I have a multidimensional-array which looks like this: $array = ( [0] => array
I have a multidimensional array or arrays which I also use in my configuration
I have a multidimensional array in which the first level keys needs to be
I have a multidimensional array which looks like this: Array ( [0] => Array

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.