How do i compare 2 integers this is the code i'm writing

int w1 = tempNum.compareTo(time);

the complie error says : int cannot be derefferrenced

The code is listed below ; Please reply ASAP

public void add(String j, String p){

int time = Integer.parseInt(p);

//System.out.println(size());

if (size() ==0){


v.addElement(j+"$"+p);



}else if(size() == numAppointments){

System.out.println(numAppointments);
System.out.println("DateBook is Full");
}
else {

int w = size();
for(int i=0; i<=w;i++){
String tempElement = get(i); //Getting the Element
int w1 = tempElement.indexOf("$"); // Looking for the index to sort

String tempNumber = tempElement.substring(w1+1,w1+2); // Extracting out the number

int tempNum = Integer.parseInt(tempNumber); // Converting it into an int

int num1 = tempNum.compareTo(time); //Comparing them
if(num1<0){
v.add(i,j+"$"+p);
}
else if(num1==0){
v.add(i,j+"$"+p);
}
else {
v.add(i+1,j+"$"+p);
}
}
System.out.println("Dumb");
}
}