Question about Microsoft Windows XP Professional With Servise Pack 2 (e8503040) for PC

1 Answer

To merge two arrays A and B in java source code.

A java program.pls help me out.

Posted by on

Ad

1 Answer

  • Level 1:

    An expert who has achieved level 1.

  • Contributor
  • 2 Answers

Do you need them to be sorted after the merge and are they already sorted? If not, then what you can do is create a temporary third array which will set the half of third array equal to the first array, and then set the set half equal to the second array. If they need to be sorted, I can help too but you need to tell me

public class ArrayMerge
{
public static int arr1[] = new int [20];
public static int arr2[] = new int [20];

public static void main()
{
setScores(arr1);
setScores(arr2);
printScores(arr1);
printScores(arr2);
printScores(merger(arr1,arr2));
}

public static void setScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
a[x]= (int)(Math.random() * 100)+1;
}
}

public static void printScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
System.out.print(a[x] + " ");
}
System.out.println();
}

public static int[] merger(int a1[], int a2[])
{
int a3[] = new int [(a1.length + a2.length)];

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

for(int x = 0; x<a2.length; x++)
{
a3[x+a2.length]=a2[x];
}
return a3;
}
}

Posted on Mar 07, 2009

Ad

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya Technician can help you resolve that issue over the phone in a minute or two.
Best thing about this new service is that you are never placed on hold and get to talk to real repair professionals here in the US.
click here to Talk to a Technician (only for users in the US for now) and get all the help you need.
Goodluck!

Posted on Jan 02, 2017

Ad

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

I need a source code of a online examination in java


i believe you need an online test software java source code.
for this you should consult programming help sites. such as 1000projects.com , source code planet.com etc.

Nov 12, 2010 | Computers & Internet

2 Answers

Unable to run java based program


go google and search for your 5130 java software

Jul 08, 2010 | Nokia 5130 Cellular Phone

1 Answer

Ple tell me how to run the "javac" command in my laptop iam already installed the 1 6 version of java, and I set path is "C:Program Files (x86)Javajre1.6.0_16in", "java" command is exetues but java c...


javac is the JavaCompiler, You've downloaded the Java Runtime. You need to download the SDK, which includes javac.
http://java.sun.com/javaee/downloads/index.jsp

Jan 24, 2010 | Sun Java System Web Server 6.1...

4 Answers

Java is not working


Hello there :
first you are going to want to ensure that your your current version of java is installed correctly and is not corrupted and if it needs to be reinstalled
download the latest java version and reinstall this . www.java.com
this should be able to take care of the problem that you are having ok?
best regards michael

Aug 23, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

2 Answers

Merging two arrays and sort them


NEED A NEW KEY THE ONE ON THE BOX WONT WORK

Jul 29, 2009 | Microsoft Windows XP Professional With...

1 Answer

Java program


It might have been got by you from web browser

Jul 13, 2009 | Microsoft Windows XP Professional

2 Answers

Source code in java that display bio data


program that display first name and second name

Jun 18, 2009 | Sun Java Programming Language (cdj-275)

Not finding what you are looking for?
Microsoft Windows XP Professional With Servise Pack 2 (e8503040) for PC Logo

Related Topics:

1,596 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2936 Answers

Piyal Perera
Piyal Perera

Level 3 Expert

528 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18414 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...