
Question.what is the difference between a function and a method?
ans.A method is a function that is written in a class.we don't have function in java; instead we have methods. This means whenever a function is written in java,it should be written inside the class only.
#freshers
English