Module 4 (Midterm) Flashcards
Learn about method calls and placement Identify the parts of a method Add parameters to methods Create methods that return values Learn about Classes and Objects Create a class Create instance methods in a class Declare objects and use their methods
Object-oriented programming System(OOPs) is a programming paradigm based on the concept of “_______” that contain data and methods.
objects
The primary purpose of object-oriented programming is to increase the _______ and _______ of programs.
- flexibility
- maintainability
Object oriented programming brings together data and its behaviour(methods) in a single location(object) makes it easier to understand how a program works.
Object oriented programming
A _________ is a program module, contains a series of statements that carries out a task.
-object
-variable
-method
-class
method
executes automatically when you run a program. It can execute additional methods, and those methods can execute others.
-predefined method
-main() method
-method
-user-defined method
main() method
To execute a method, _________ or _________from another method
Invoke or call from another method
The calling method (client method) makes a method call
-True
-False
T
The method header is also called a(n) ________
-declaration
-identifier
-access specifier
-definition
declaration
Every method must include the two parts:
- Method header
- Method body
_________ is found between a pair of curly braces. It Contains the statements that carry out the work.
Method body
Method body is also called _________
-instance
-declaration
-implementation
-content
implementation
Which is a method header:
- public static void main(String[] args)
-public class First
-methodName()
-public static void methodName()
public static void main(String[] args)
public static void methodName()
The method header contains (give 4):
Optional access specifiers
A return type
An identifier
Parentheses
The method must be placed within the main() that will use it
-True
-False
False
-Place the entire method within the class that will use it
-Not within any other method
Access specifiers can be (Give 4):
public
private
protected
package