COMPUTER PROGRAMMING FUNDAMENTALS
PROGRAMMING LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Machine
|
|
Assembly
|
|
Java
|
|
None of the above
|
Detailed explanation-1: -Every subroutine in Java must be defined inside some class. This makes Java rather unusual among programming languages, since most languages allow free-floating, independent subroutines. One purpose of a class is to group together related subroutines and variables.
Detailed explanation-2: -A method in Java is a subroutine that is part of a class. The subroutine is like a miniature program that can execute in other parts of the program. Methods promote code reuse and maintainability. A method definition consists of the modifier, return type, name, parameter list, exception list, and body.
Detailed explanation-3: -Subroutine’s name is simply a name for identification purpose and you cannot use it in any statement except the CALL statement. A subroutine receives its input values from its formal arguments, does computations, and saves the results in some of its formal arguments.