0% found this document useful (0 votes)
59 views1 page

Java Array Sorting and Copying

This Java code defines a vectori_1 class with a main method. It declares an integer array v initialized with values {4,3,5,2}, sorts v in reverse order, copies elements 2-3 of v into a new array a, copies elements 1-4 of v into a starting at index 1 of a, prints the sorted v array, and prints the resulting a array.

Uploaded by

romach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views1 page

Java Array Sorting and Copying

This Java code defines a vectori_1 class with a main method. It declares an integer array v initialized with values {4,3,5,2}, sorts v in reverse order, copies elements 2-3 of v into a new array a, copies elements 1-4 of v into a starting at index 1 of a, prints the sorted v array, and prints the resulting a array.

Uploaded by

romach
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

//import [Link].

Collections;

//import [Link];

class vectori_1{

public static void main(String args[]){

Integer [] v = {4,3,5,2};

Integer [] a = new Integer[[Link]];

[Link](v, [Link]());

a = [Link](v, 2, 3);

[Link](v,1,a,1,4);

[Link]([Link](v));

[Link]([Link](a));

You might also like