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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:58:43+00:00 2026-06-18T02:58:43+00:00

Possible Duplicate: how to add new elements to a String[] array? How can I

  • 0

Possible Duplicate:
how to add new elements to a String[] array?

How can I add new item to the String array ? I am trying to add item to the initially empty String. Example :

  String a [];

  a.add("kk" );
  a.add("pp");
  • 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-18T02:58:44+00:00Added an answer on June 18, 2026 at 2:58 am

    From arrays

    An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You’ve seen an example of arrays already, in the main method of the “Hello World!” application. This section discusses arrays in greater detail.

    enter image description here

    So in the case of a String array, once you create it with some length, you can’t modify it,
    but you can add elements until you fill it.

    String[] arr = new String[10]; // 10 is the length of the array.
    arr[0] = "kk";
    arr[1] = "pp";
    ...
    

    So if your requirement is to add many objects, it’s recommended that you use Lists like:

    List<String> a = new ArrayList<String>();
    a.add("kk");
    a.add("pp"); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: PHP - add item to beginning of associative array have associative array:
Possible Duplicate: How can I add resizable widgets in Qt Creator? I am using
Possible Duplicate: how to add new line to email contents? I want to send
Possible Duplicate: How can I detect when a new element has been added to
Possible Duplicate: How to add 30 minutes to a javascript Date object? I can
Possible Duplicate: Common elements in two lists I am trying to take 2 lists
Possible Duplicate: How to add two numbers of any length in java? can anyone
Possible Duplicate: Add table row in jQuery I want to add a new row
Possible Duplicate: More efficient way to remove elements from an array list I have
Possible Duplicate: foreach with three variables add I'm new to PHP so bear with

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.