-8

I was wondering What is the different between Method and Function in JAVA?

Litisqe Kumar
  • 2,512
  • 4
  • 26
  • 40
Android
  • 1
  • 1
  • 6
    Google is your friend. – Bidhan May 29 '15 at 03:14
  • http://stackoverflow.com/questions/155609/difference-between-a-method-and-a-function – sfletche May 29 '15 at 03:14
  • functions **are** methods. It's only another name. Methods, in VB NET, indicate both `subs` (which are `void functions`, in other languages such as Java) and `functions` (which return a value). You can also call methods `routines`, if you prefer. – Phantômaxx May 29 '15 at 05:01

1 Answers1

-1

it the same, function or methods are just different ways to call it, but in my long experience with java i commonly hear function from my fellow developers the last time i heard anyone say 'method' was back when i still used C++

jyonkheel
  • 443
  • 4
  • 17
  • 1
    be warned methods and functions are different on C++, in java how ever it is the same thing – jyonkheel May 29 '15 at 03:20
  • Really? I usually hear people referring to Java "methods", not "functions". Java is not a functional programming language, so personally, "method" makes more sense to me. – hungryghost May 29 '15 at 03:38
  • 1
    well i literally hear my fellow java devs (at my workplace) call them functions instead of method, how ever upon thinking again and looking at java API itself we could see method is the official term to be used [link to API](https://docs.oracle.com/javase/8/docs/api/), and function is nowhere to be found, but it is basically the same thing anyway – jyonkheel May 29 '15 at 03:47
  • I'm not disagreeing with your answer. The terms can be used interchangeably when talking about Java. I'm just surprised you hear "function" used more often than "method", because my experience is the opposite. – hungryghost May 29 '15 at 04:20