Merging Of Array

Discussion in 'Java' started by angad_aks, Feb 15, 2011.

  1. angad_aks

    angad_aks Banned

    Joined:
    Feb 15, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    Code:
    import java.io.*;
    class merge_array
    {
    public static void main(int a, int b)throws IOException
    {
    int c;
    int A[] = new int[a];
    int B[] = new int [b];
    c = a+b;
    int C[]= new int[c];
    for(i=0; i<a; i++)
    {
    A[i] = Iteger.parseInt(in.readLine());
        }
        for(j=0;j<b; j++)
        {
            B[j]=Integer.parseInt(in.readLine());
        }
        for(i=0;i<a;i++)
        {
            c[i]=A[i];
        }
        for(j=0; j<b;j++)
        {
            c[i]=B[j];
            i++;
        }
    }
        }
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    This is Java, not C++. If you're going to post demo code, you should at least get the language right. If we don't have a Java forum, that means we're not interested in Java demo programs, right?
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Moved to Java forum
     
  4. angad_aks

    angad_aks Banned

    Joined:
    Feb 15, 2011
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    thanks admin. many thanx 4 encouraging
     
  5. lionaneesh

    lionaneesh Active Member

    Joined:
    Mar 21, 2010
    Messages:
    848
    Likes Received:
    224
    Trophy Points:
    43
    Occupation:
    Student
    Location:
    India
    angad you should understand the point 'xpi0t0s' want to say...We have told you and others too in previous posts that if you want to post sample code..

    It should be some thing different or at least it should have some great commenting so as to make the viewers understand!!!
     
  6. virxen

    virxen Active Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    28

    and the question is?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice