Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Array Merger

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Array Merger

    Hey guys good evening
    im new to java and here as well, hope you guys can help me with this:
    so the thing is i want to combine 2 int arrays with a size of 5 so the total size would be 10

    and put it in a String so that i can see it,
    and later on try to compare and clear out the numbers that are common
    example:
    array1[5] = 1,2,3,4,5
    array2=5,6,7,8,9

    the numbers that you have inputted are: 1,2,3,4,5,5,6,7,8,9
    After execution: 1,2,3,4,5,6,7,8,9

    there hope you can help me guys this is what i got so far:
    public static void main(String[] args) {
    int[] firstArray ={1,2,3,4,5};
    int[] secondArray ={6,7,8,9,10};
    int first=0;
    int second=0;
    String combine="";
    String una="";
    String pang="";



    for(int x=0;x<firstArray.length;x++){
    una=firstArray[x];
    }



    }

    }


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Array Merger

    Also posted at: Array Merger
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Array List of Array Lists working for first item but not for second.
    By javapenguin in forum Collections and Generics
    Replies: 6
    Last Post: February 15th, 2012, 05:12 PM
  2. Replies: 4
    Last Post: November 14th, 2011, 10:00 PM
  3. Doubling The Array Size And Randomizing Array Return
    By Pingu00 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: June 27th, 2011, 10:50 AM
  4. Replies: 2
    Last Post: May 13th, 2011, 03:08 AM
  5. Replies: 2
    Last Post: May 6th, 2011, 05:19 PM