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

The Archive Base Latest Questions

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

is there a way to convert three single dimensional arrays into a multi-dimensional one.

  • 0

is there a way to convert three single dimensional arrays into a multi-dimensional one.
For example I have three arrays (text, retweets, geo) how can I merge them so it appears as:-

The arrays I want to merge are something along the lines of text = ‘hello, ‘hello’. retweets = ‘2,5’ and geo = ‘19912, 929293’.

And should result in:-

combined = 
[hello, 2, 19912
hello, 5, 929293]

and so one… All of the arrays are the same sizes. I know I should loop through while a for loop somehow but am not quite sure how to implement it.

Thanks to any response.

  • 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-18T08:11:40+00:00Added an answer on June 18, 2026 at 8:11 am
    public static void main(String[] args) {
    
        String[] array1 = { "hello1", "A2", "X19912" };
        String[] array2 = { "hello2", "B2", "Y19912" };
        String[] array3 = { "hello3", "C2", "Z19912" };
        String[] copyArrays = new String[array1.length + array2.length
                + array3.length];
        System.arraycopy(array1, 0, copyArrays, 0, array1.length);
        System.arraycopy(array2, 0, copyArrays, array1.length, array2.length);
        System.arraycopy(array3, 0, copyArrays, array1.length + array2.length,
                array3.length);
    
        String[][] array = new String[3][3];
        int index = 0;
        for (int i = 0; i < array.length; i++)
            for (int j = 0; j < array[i].length; j++) {
                array[i][j] = copyArrays[index++];
            }
    
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
    
                System.out.print(array[i][j] + "  ");
            }
            System.out.println();
        }
    }
    

    Output:

    hello1  A2  X19912  
    hello2  B2  Y19912  
    hello3  C2  Z19912 
    

    This code will first copy the given arrays into a new array. Then it will insert all elements of copyArrays into a 2d array using for loop .

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

Sidebar

Related Questions

I have several classes in one single file each. Is there a quick way
is there a way in Java to convert an Integer to single digits, and
Is there some way in the Win32 API to convert a three letter language
Is there a way to convert twitter bootstrap's typeahead function into a $(body).on() function?
Is there any way to convert a android.graphics.Bitmap instance into jpeg in android?
Is there a way to convert a Java application into a Mac OS X
Is there a way to convert HTML into XAML? I noticed that you can
Is there a way to convert an int to a bitmask? example: int i
Is there an easy way to convert a string array into a concatenated string?
Is there a way to convert a single column record set such as 1

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.