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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:17:01+00:00 2026-05-23T23:17:01+00:00

i have this arraylist and i want to put the data in array.but i

  • 0

i have this arraylist and i want to put the data in array.but i have the problem to separate the data.
ArrayList data_list:

g e r m a n y
a u s t r a l i a
n e w z e a l a n d
e n g l a n d
c o s t a r i c a
p h i l i p i n a
m y a n m a r
t h a i l a n d

note:each of letter is separate by space.
i want to separate the name of the country to into separate letter such as
germany becomes g e r m a n y
i plan to convert the arraylist to 2d array.so the output become like this:
String[][] country;

country[0][0]=g
country[0][1]=e
country[0][2]=r
country[0][3]=m
country[0][4]=a
country[0][5]=n
country[0][6]=y

country[1][0]=a
country[1][1]=u
country[1][2]=s
country[1][3]=t
country[1][4]=r
country[1][5]=a
country[1][6]=l
country[1][7]=i
country[1][8]=a

anyone can help me?

  • 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-05-23T23:17:02+00:00Added an answer on May 23, 2026 at 11:17 pm

    If your ArrayList looks like this:

    List<String> countries = Arrays.asList("g e r m a n y", "a u s t r a l i a", "n e w z e a l a n d",
        "e n g l a n d", "c o s t a r i c a", "p h i l i p i n a", "m y a n m a r", "t h a i l a n d");
    

    Then you can create your array of characters this way:

    String[][] countryLetters = new String[countries.size()][];
    for (int i = 0; i < countries.size(); i++) {
        String country = countries.get(i);
        countryLetters[i] = country.split(" ");
    }
    // test output
    for (String[] c : countryLetters) {
        System.out.println(Arrays.toString(c));
    }
    

    The test output is

    [g, e, r, m, a, n, y]
    [a, u, s, t, r, a, l, i, a]
    [n, e, w, z, e, a, l, a, n, d]
    [e, n, g, l, a, n, d]
    [c, o, s, t, a, r, i, c, a]
    [p, h, i, l, i, p, i, n, a]
    [m, y, a, n, m, a, r]
    [t, h, a, i, l, a, n, d]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an arraylist called 'pri1', I want this array list to be available
I want to put some numbers from Excel to array. Let's say I have
I have this variable: protected ArrayList<String> list = new ArrayList<String>(); The data is in
Closed as exact duplicate of this question . I have an array/list of elements.
I have this code in jQuery, that I want to reimplement with the prototype
I have this idea for a free backup application. The largest problem I need
I have this method on a webpart: private IFilterData _filterData = null; [ConnectionConsumer(Filter Data
If I have an ArrayList that has lines of data that could look like:
I have page gets given an ArrayList<Document> where each document has a property called
If I have a Map like this: HashMap<Integer, ComparableObject> map; and I want to

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.