Computer Applications
Write two advantages of using functions in a program.
User Defined Methods
ICSE 2010
13 Likes
Answer
- Methods help to manage the complexity of the program by dividing a bigger complex task into smaller, easily understood tasks.
- Methods help with code reusability.
Answered By
9 Likes
Related Questions
Method prototype for the method compute which accepts two integer arguments and returns true/false.
- void compute (int a, int b)
- boolean compute (int a, int b)
- Boolean compute (int a,b)
- int compute (int a, int b)
Consider the following program segment and answer the questions below:
class calculate { int a; double b; calculate() { a=0; b=0.0; } calculate(int x, double y) { a=x; b=y; } void sum() { System.out.println(a*b); }}Name the type of constructors used in the above program segment?
Invoking a method by passing the objects of a class is termed as:
- Call by reference
- Call by value
- Call by method
- Call by constructor