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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:09:33+00:00 2026-06-16T15:09:33+00:00

I am new in Java so I need little help I have String []

  • 0

I am new in Java so I need little help

I have

String [] scripts = new String [] ("test3","test4","test5");

and I want to add new strings ( string1,string2) to this array ( scripts) for examples

String string1= " test1"
String string2 = "test2"

I want to add the new string not in the init but in later phase

How I can do it ?

  • 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-16T15:09:35+00:00Added an answer on June 16, 2026 at 3:09 pm

    You cannot resize an array in java.

    Once the size of array is declared, it remains fixed.

    Instead you can use ArrayList that has dynamic size, meaning you don’t need to worry about its size. If your array list is not big enough to accommodate new values then it will be resized automatically.

    ArrayList<String> ar = new ArrayList<String>();
    String s1 ="Test1";
    String s2 ="Test2";
    String s3 ="Test3";
    ar.add(s1);
    ar.add(s2);
    ar.add(s3);
    
    String s4 ="Test4";
    ar.add(s4);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im new to Android and I need a little help. I have a class
I'm new to java and really need some help. I created a command line
I'm new to java and packages and need some help navigating them. Currently I
I've a lot of Java experience but new to C++. I need to have
I need a little help here.So basically I have to make a test of
I have made a little program in java that accepts a string as a
I need a little help. I'm trying to put together a small Java program
I'm relatively new to Java, so I have little to no idea where to
I am new to Java web service and need to be familiar with REST
I am new to java Swing and I need a tool to develop attractive

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.