Merging Of Array

angad_aks's Avatar
Banned
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++;
    }
}
    }
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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?
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved to Java forum
angad_aks's Avatar
Banned
thanks admin. many thanx 4 encouraging
lionaneesh's Avatar, Join Date: Mar 2010
Invasive contributor
Quote:
Originally Posted by angad_aks View Post
thanks admin. many thanx 4 encouraging
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!!!
virxen's Avatar, Join Date: Nov 2009
Pro contributor
Quote:
Originally Posted by angad_aks View Post
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++;
    }
}
    }

and the question is?