hello everyone i'm kinda new in java and i'm having trouble with the method swap which is not taking effect here's the code
Code:import java.util.*;
public class methodstest1 {
public static void swap(int a, int b){
if(a>b){
int temp =a;
a=b;
temp=b;
}
}
public static int sum(int a, int b){
int summ=0;
for(int i=a; i<b; i++){
summ+=i;
}
return summ;
}
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("type first delimiter ");
int del1=input.nextInt();
System.out.print("type 2nd delimiter ");
int del2=input.nextInt();
swap(del1, del2);
System.out.println(" total sum = "+sum(del1, del2));
}
}
output : the program is supposed to sum all numbers written by user as delimiters, the method swap is supposed swapping delimiters in case the 1st one is superior to the 2nd but it's not taking effect , i know i'm doing a stupid error but i just can't locate it, if someone could help me with this and thx

