File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What is a method ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What is a method ?" Watch "What is a method ?" New topic

What is a method ?

amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

Hi everybody,

Choices :
1)implementation of an abstraction .
2)defines the behaviour.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
I'd say 1, though that answer could also apply to a class.
2 is more correct for an interface, but I think a case could be made to have it apply to a method.
Division by zero, out of cheese error, universe halted.

Ajay Patel
Ranch Hand

Joined: Jan 02, 2001
Posts: 39
i would say 2.
Because classes are implementation of abstraction.
Variables define the Properties of a class.
Methods definte the Behaviour of a class.
[This message has been edited by Aj Patel (edited January 07, 2001).]
amit sanghai
Ranch Hand

Joined: Dec 05, 2000
Posts: 231

Hi Aj and Jeroen,
This question was from Khalid's mock exam. The answer diven is (2).
Kalidas Pavi
Ranch Hand

Joined: Nov 20, 2000
Posts: 42
Agreed 2.
Methods can be considered as the counterparts of functions of procedural languages. Methods operates upon the data (fields) of a class and hence defines the behaviour of the class.
I agree. Here's the link:
subject: What is a method ?
It's not a secret anymore!