Expressions, Statements, Blocks, and Branches Flashcards

1
Q

Expression

A

Is a combination of one or more explicit values, constants, variables, operators, and functions that the programming language interprets and computes to produce another value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Statements

A

Is a syntactic unit of an imperative programming language that expresses some action to be carried out. Statements in Java are terminated by a semi-colon ( ; ) and may contain expressions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Blocks

A

Block is a group of statements that needs to be executed as a single unit.
In Java, blocks are identified by curly-braces { }.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Methods

A

Create a reusable block of code.

Methods are defined by a Method Signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Method Signature

A

Consists of an accessor + return_data_type + name + ( parameters )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Accessor

A

A keyword, like public, private or protected, that identifies who can use the method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Return type

A

A Data Type, (int, double, String), that identifies the output - what type of data the method will return.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Name

A

A descriptive name that can be used to call the method, causing the code in it’s code block to execute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Parameters

A

A list of variables, contained in ( ) that must be populated when calling the method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Parts of a Method

A

Method Signature - Code Block - Return statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Code Block

A

Code to execute when the method is used. Defined by { } following the method signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Return statement

A

Statement of code that tells the method what value to return. This value must be the same data type as a methods return type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Boolean Expression

A

An expression that evaluates to a single boolean value (true or false). Commonly used to conditionally decide what code to execute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Comparison Operators

A

Used to compare two values. Can only be used with int, long, short, byte, boolean, double, and float data types. Cannot be used with String.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Logical Operators

A

Combines two or more boolean expressions, such that they evaluate to a single value. In natural language these are represented by AND, OR and NOT.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly