Computer Applications
What are the three types of functions in Java?
User Defined Methods
11 Likes
Answer
The three types of functions in Java are-
- Computational methods — The methods that calculate or compute some value and return the computed value. Computational methods always return a computed result. For example, Math.sqrt( ) and Math.cos( ).
- Manipulative methods — The methods that manipulate information and return a success or failure code. Generally, if value 0 is returned, it denotes successful operation; any other number denotes failure.
- Procedural methods — The methods that perform an action and have no explicit return value. For instance, System.out.println() method is a procedural method.
Answered By
6 Likes
Related Questions
What is the principal reason for passing arguments by reference ? In a function call, what all data items can be passed by reference ?
What is the role of a return statement in a method ?
Write a function that interchanges the value of two integers A and B without using any extra variable.
Give the prototype of a function check which receives a character ch and an integer n and returns true or false.