return statement in a function in a if else condition not working Java Help Urgent?

Ahmed

New member
this function is part of my program

public boolean isExist(int data) {
for(ip=start; p!=null; p=p.next) {
if(p.data==data return true;

else return false;
}
}

data is an int type which is instance variable of class;
here problem is this my compiler giving error that return statement is missing compiler is not seeing return statement in if else conditions..

when i put it in main body of isExist it fine but else it not works
 
Back
Top