Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:58:27+00:00 2026-06-10T22:58:27+00:00

I was looking for an equivalent of *php’s array_multisort* in java. //array 1 ar1

  • 0

I was looking for an equivalent of *php’s array_multisort* in java.

//array 1
ar1 = array(10, 100, 100, 0);
//array 2
ar2 = array(1, 3, 2, 4);
//calling the function
//this will sort the array at first based one the first array and then based on the    
//second array so these two array are related
array_multisort(ar1, ar2);


//resultant 1st array
array(4) {
[0]=> int(0)
[1]=> int(10)
[2]=> int(100)
[3]=> int(100)  
}

//resultant 2nd array
//this array has been sorted based on the first array at first

array(4) {
[0]=> int(4) // this is associative element of 0 in the first array 
[1]=> int(1) //this is associative element of 10 in the first array 
[2]=> int(2) //this is associative element of  1st 100 from the last in the first array 
             //as there are two 100's , and last one's associative value in the second
             //array is smaller it will come first   
[3]=> int(3)
}

how can i achieve this result using something built-in , i know how to implement it using custom code.

N.B. *Please visit this link before answering the question as that explains how the function should work*

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:58:29+00:00Added an answer on June 10, 2026 at 10:58 pm

    It’s look like that there is not any built-in library function / class for this purpose in Java .
    If you are also facing this problem like me , so far Thomas’s answer about the custom code can help you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a java equivalent to this php call: hash_hmac('sha1', test, secret) I
I'm looking for the equivalent to the PHP function mysql_real_escape_string() to use in C#.NET.
I'm looking for Java's equivalent of PHP's isset() ; int board[][]=new int[8][8]; ... if(isset(board[y][x]))
I was looking for a Pascal equivalent for (for example) the php's substr function,
Looking for the python equivalent of this. http://php.net/extract
I've been looking for a js-equivalent for the PHP preg_replace function and what I
I'm looking for a C# equivalent for the php sprintf function. I have the
I'm looking for the javascript equivalent of the php function isset() . I've tried
I'm looking for the equivalent function of sprite.graphics.curveTo() in ActionScript for PHP with Imagick.
I am no PHP expert. I am looking for the PHP equivalent of isLetter()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.