Geeks Talk

Prepare for your Next Interview




Differences Between Method and Function

This is a discussion on Differences Between Method and Function within the Java forums, part of the Software Development category; can any one explain clearly what is the difference between the Method and a Function, if possible by using some syntax and examples....


Go Back   Geeks Talk > Software Development > Java

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-20-2008
Junior Member
 
Join Date: May 2008
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
chaitu4u4ever is on a distinguished road
Differences Between Method and Function

can any one explain clearly what is the difference between the Method and a Function, if possible by using some syntax and examples.
Reply With Quote
The Following User Says Thank You to chaitu4u4ever For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 05-22-2008
Junior Member
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
rohitmania is on a distinguished road
Re: Differences Between Method and Function

no difference according to me...

method is OO concept related to class
i.e. function written for a class = method

this is my wild guess...
as per my knowledge it hardly makes any difference.
Reply With Quote
  #3 (permalink)  
Old 08-26-2008
Junior Member
 
Join Date: Aug 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
sjava.438 is on a distinguished road
Re: Differences Between Method and Function

Hi,
method should declares and defines within the class only. so it has access controlling mechanism. used in oops.
function declares and defines anywhere in the code. it has not access controlling. used in structured language.
even behavior is same.

thanks
Reply With Quote
  #4 (permalink)  
Old 08-26-2008
Expert Member
 
Join Date: Jun 2007
Location: Australia
Posts: 242
Thanks: 6
Thanked 8 Times in 8 Posts
Sushma Mosali is on a distinguished road
Re: Differences Between Method and Function

hi,

In java function is call itself as a method.... there is not any difference in those thng.... it just using of terms...like in c++ we call it functins..and in java we call it as methods. In more simple terms Method does not take any arguement and it is invoked by method call
whereas function may or may not take the arguements?
Also Method does't return any thing but the function can return any thing

Thanks
Sushma
Reply With Quote
  #5 (permalink)  
Old 08-31-2008
Junior Member
 
Join Date: Aug 2008
Location: hyderabad
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
pramodh852 is on a distinguished road
Re: Differences Between Method and Function

both r same but method does't return any thing and function returns any thing
Reply With Quote
  #6 (permalink)  
Old 09-13-2008
Junior Member
 
Join Date: Sep 2008
Location: hyderabad
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
nagamalli56 is on a distinguished road
Re: Differences Between Method and Function

Hi,
method should declares and defines within the class only. so it has access controlling mechanism. used in oops.
function declares and defines anywhere in the code. it has not access controlling. used in structured language.
even behavior is same.

thanks
Reply With Quote
  #7 (permalink)  
Old 09-17-2008
Junior Member
 
Join Date: Sep 2008
Location: india
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
mkranthikumar.mca is on a distinguished road
Re: Differences Between Method and Function

Function and Method both are same. But if it is declared outside of class it is function and if it is declared within class that is method.
In case of C++ it will support both functions and methods
But In case of Java there is no Functions concept only method is alloed.
Reply With Quote
  #8 (permalink)  
Old 4 Weeks Ago
Junior Member
 
Join Date: Oct 2008
Location: India
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
nikku.aryan is on a distinguished road
Re: Differences Between Method and Function

Quote:
Originally Posted by pramodh852 View Post
both r same but method does't return any thing and function returns any thing
hi,
look friend, according to u method does not return any value is like a wrong concept because it returns the value in java.
thanks
Reply With Quote
Reply

  Geeks Talk > Software Development > Java


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Differences between SQL, SQL Server, My Sql, MS SQL? chennaprashanth SQL Server 0 03-18-2008 05:01 AM
differences chandanavemulapally C and C++ 3 12-19-2007 04:03 AM
differences between QTP & RFT bvani QTP 1 09-05-2007 07:47 PM
Differences pkishoreroy Data Warehousing 2 04-04-2007 12:29 AM
Differences Needed fred Web Design 1 07-26-2006 04:54 PM


All times are GMT -4. The time now is 05:50 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved