Priyanka,
Welcome to the Ranch.
I have closed the same question which you had posted in the
Servlets forum. Please choose a proper forum and do not post the same question in multiple places.
More information
here
Coming back to your question. Please take efforts to frame your thoughts in proper English.
Method and function mean the same. So there is no difference.