i'm trying to write a sign in activity , i wrote the hashPassword function below. Why does it give a different result for the same salt and password? 
  import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
public class Main {
    public static void main(String[] args) {
        System.out.println("Hello World!");
       try { System.out.println("test1: "+hashPassword("[B@2b1e4124","bfnfnfjfjf"));
           System.out.println("test2: "+hashPassword("[B@2b1e4124","bfnfnfjfjf"));}
       catch (NoSuchAlgorithmException | InvalidKeySpecException e){}
    }
     public static  String hashPassword(String password, String salt) throws NoSuchAlgorithmException, InvalidKeySpecException {
        char[] passwordChars = password.toCharArray();
        byte[] saltBytes =salt.getBytes();
        PBEKeySpec spec = new PBEKeySpec(
                passwordChars,
                saltBytes,
                5000,
                10
        );
        SecretKeyFactory key = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512");
        byte[] hashedPassword = key.generateSecret(spec).getEncoded();
        return hashedPassword.toString();
    }
}
 
     
    