+ 6

What is the difference between method and function in java?

pls specify with any day to day example??

12th Jun 2017, 12:32 AM
PRAVEEN TIWARI
PRAVEEN TIWARI - avatar
2 odpowiedzi
+ 8
Answered this a while ago, have a look! https://www.sololearn.com/Discuss/458470/?ref=app
12th Jun 2017, 1:40 AM
Tamra
Tamra - avatar
+ 7
The diiference is mostly semantical. A method is just a function attached to an object: a car would have a start() method, wich would be a function embeded inside the car... wash() could be a function, not linked to a car object specifically (cars doesn't embed such functionnality ^^), but could be also a method for an oven, wich could provide this functionnality ;)
12th Jun 2017, 12:45 AM
visph
visph - avatar