I wrote my code and i want return multiple values in :
public int[] getResult(){
return geneticAlgorithm(cost,profit,gens,turns,cmax);
but when i use this show me eror:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: knapsacproject.algorithm.geneticAlgorithm([I[IIII)[I
at knapsacproject.algorithm.geneticAlgorithm(Native Method)
at knapsacproject.algorithm.getResult(algorithm.java:39)
my code :
package knapsacproject;
public class algorithm {
public native int [] geneticAlgorithm(int[] cost, int[] profit,int cmax, int gens, int turns);
static {
try {
System.load("C:/Users/Desktop/dp/KnapSacProject/src/knapsacproject/helo.dll");
System.out.println("loaded successfully");
} catch (Exception e){
e.printStackTrace();
}
}
protected int[] cost, profit, result;
protected int gens, turns, cmax;
public algorithm(int[] cost,int[] profit, int gens ,int turns , int cmax ) {
this.cost=cost;
this.profit=profit;
this.gens=gens;
this.turns=turns;
this.cmax=cmax;
}
public int[] getResult(){
return geneticAlgorithm(cost,profit,gens,turns,cmax);
}
public static void main (String[] args ) {
}
}
So How do I return multiple value or How do I fix this?