Java 1 Flashcards

1
Q

Object orientation

A

An approach that supports the creation, enhancement and maintenance of complex IT systems

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

Method

A

An element of objects that is used to create, read, change and perform calculations on the values of attributes

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

Class

A

A structure that is used to create digital objects which are the central elements in the OO software development process

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

Analysis model

A

The result of the OO analysis, which is used for communication between developers and client and/or users of system

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

Complier

A

A software that translates a program code into a form that can be executed by a computer

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

Bytecode

A

The form of Java program after its compilation that can be executed with JRE

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

Default value

A

A value that is assigned to an attribute automatically when the object is created

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

Principle of data encapsulation

A

An object can never directly access attributes of another object or changing them. It is possible only by getters and setters

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

Method signature

A

Method name + parameters list. RETURN TYPE IS NOT A PART OF METHOD SIGNATURE

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

Method overloading

A

This process is sued too implement multiple methods with same name and different parameters list

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

Syntax error

A

Error in code construction

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

Runtime error

A

Error that causes a program to terminate abnormally

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

Logic error

A

Error that occurs when a program does not perform the way it was intended to

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

Pseudocode

A

Natural language mixed with some programming code

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

Variable

A

Value which is stored in computer memory

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

Data type

A

The kind of data that is stored in a variable

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

Specific import

A

Import that specifies a single class

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

Wildcard import

A

Import all classes from a package

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

Scope of variable

A

Is the part of the program where the variable can be referenced

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

Named constant

A

Is an identifier that represents a permanent value

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

Literal

A

Is a constant value that appears directly in a program

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

Casting

A

Is an operation that converts a value of one data type into a value of another data type

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

Software development lifecycle

A

Is a multistage process that includes requirements specification, analysis, design, implementing, testing, deployment, maintenance

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

Round off error

A

The difference between the calculated approximation of a number and its exact mathematical value

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

Primitive data type

A

Data type where values are not objects (logical values, integers, floating point numbers, single characters)

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

Arithmetic operator

A

Operator for executing mathematical functions, such as addition, subtraction, division, multiplication.

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

Logical operator

A

Operator used to run logical functions, such as negation, logical AND, logical OR, logical XOR

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

Relational operator

A

Operator used to compare expression against each other

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

Equality test operator

A

A relational operator used to run functions that test for equality or non-equality in which operands determine whether values or references are compared

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

String concatenation

A

A function of data type String which creates a new string from 2 existing strings

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

Control structures

A

Elements of programming language for conditional or nested execution of statements

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

Package

A

An element used for structuring Java classes of a development project

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

Boolean expression

A

Is an expression that evaluates to a Boolean value

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

If statement

A

Is a construct that enables a program to specify alternative paths of execution

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

Flowchart

A

A diagram that describes an algorithm or process, showing steps as boxes of various kinds and their order by connecting these boxes with arrows

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

Nested if statement

A

The inner if statement in the another if statement

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

Fail-through behaviour

A

Once a case in switch statement is matched, the statements from the matched case are executed until the break statement or the end of the switch statement is reached

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

Conditional operator

A

(a ternary operator) operator that evaluates an expression based on a condition

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

Conditional branch

A

A control structure that is used to execute statements based on multiple, mutually exclusive conditions

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

Loop

A

A control structure used for executing statements repeatedly

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

Debugging

A

Process of finding and fixing logical errors in a program

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

Escape character

A

Special notation that consists of a backslash followed by a character or combination of digits

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

String

A

Sequence of characters

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

IS-A relationship

A

The relationship that expresses the fact that a class is a special type of another class

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

Superclass

A

The class from which other classes are derived

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

Subclass

A

The class that specifies a superclass by implementing an improved functionality with additional methods and attributes

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

Inheritance

A

Type of relationship that enables the abstraction of common attributes in a superclass, therefore reducing repetition in design

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

Assignment compatibility

A

A variable of the type of a superclass can also be assigned to subclass objects

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

Extension

A

A concept that used by Java to implement inheritance

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

Overriding

A

The process of implementing an inherited method

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

Loop continuation condition

A

A boolean expression that controls the execution of a loop body

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

Counter-controlled loop

A

A loop that uses the control variable to count the number of iterations

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

Sentinel value

A

The special input value that signifies the end of the input

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

Sentinel-controlled loop

A

A loop that uses a sentinel value to control its execution

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

Control variable

A

A variable that is used in a loop to control how many times the loop body is executed and when the loop terminates

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

Pre-test loop

A

A loop where loop continuation condition is checked BEFORE the loop body is executed
- while loop
- for loop

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

Post-test loop

A

A loop where loop continuation condition is checked AFTER the loop body is executed
- do while loop

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

Nested loop

A

A loop that consists of an outer loop and one or more inner loops

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

Method definition

A

Method name, parameters, return value type, body

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

Value returning method

A

A method that returns a value

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

Void method

A

A method that does not return a value

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

Method body

A

A collection of statements that implement the method

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

Method invocation

A

Calling a method

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

Pass-by-value

A

If the argument is a variable, than a literal value, is passed to the method as a parameter

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

Method overloading

A

Two methods have the same name but different parameter list within one class.
Java determines which method is used by method signature

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

Ambiguous invocation

A

There are two or more possible matches for invocation of a method but compiler cannot determine the most specific match.
Ambiguous invocation causes a compile time error

67
Q

Local variable

A

A variable that is defined inside a method

68
Q

Method abstraction

A

A separation the use of a method from its implementation. The client can use a method without knowing how it is implemented

69
Q

Top-down approach

A

An implementation of one method in the structure chart at a time from top to down

70
Q

Stub

A

A simple but incomplete version of a method that is used for the methods waiting to be implemented

71
Q

Bottom-up approach

A

An implementation of one method in the structure chart at a time from down to top

72
Q

Attribute

A

An element of objects that is used for saving concrete values

73
Q

Array

A

A data structure which stores a fixed-size sequential collection of elements of the same type

74
Q

Indexed variable

A

An index that is used to access elements of an array

75
Q

Array initializer

A

A shorthand notation, which combines the declaration, creation and initialization of an array in one statement

type[] arrayRefVar = {values…}

76
Q

For-each loop

A

A for loop that allows to traverse an array or a list without using an index variable

77
Q

Anonymous array

A

An array with no explicit reference variable

78
Q

Precondition

A

A thing that is true before the method is invoked

79
Q

Postcondition

A

A thing that is true after the method is returned

80
Q

Strictly equal arrays

A

Arrays with same corresponding elements

81
Q

Abstract class

A

A class which instances cannot be created; where common features are grouped together and an interface that must be supported by derived classes is defined

82
Q

Abstract method

A

A method that has a signature but no method body; it defines the functionality that must be implemented in subclasses

83
Q

Polymorphism

A

A declared variable of the type of a particular class can also accept instances of the subclass

84
Q

Instanceof operator

A

An operator used to run a test of class membership

85
Q

Class variable

A

An attribute that is same for all instances of a class and is accessed through the class name

86
Q

New operator

A

An operator that creates a new object for a particular class

87
Q

Standard constructor

A

A special method for creating objects of a class. Can only exist once per class

88
Q

Empty standard constructor

A

If a constructor is not defined, the compiler explicitly adds an empty standard constructor

89
Q

Garbage collection

A

Automatic memory management in Java

90
Q

Overloaded standard constructor

A

A constructor used to initialize an object with values that are only determined at runtime, so this constructor defines a parameter list

91
Q

Copy constructor

A

A constructor used for cloning objects

92
Q

Deep copy

A

All reference data types are copied

93
Q

Shallow copy

A

Only primitive data types and strings are copied

94
Q

Ragged array

A

A 2D array where rows have different length

95
Q

2D array

A

Array of 1D arrays

96
Q

3D array

A

Array of 2D arrays

97
Q

Multidimensional array

A

An array where each element is another array

98
Q

State of the object

A

Data fields with their current values

99
Q

Behavior of an object

A

Methods of an object

100
Q

Class diagram

A

A special UML notation to display class template

101
Q

Client of the class

A

The program that uses the class

102
Q

Dot operator

A

An operator used to access data and methods via the object’s reference variable

103
Q

Instance variable

A

A data field that is dependent on a specific instance

104
Q

Calling object

A

An object on which an instance method is invoked

105
Q

Visibility modifier

A

An element that specifies how data fields and methods in a class can be accessed from outside the class

106
Q

Public visibility

A

Visible: class, package, subclasses, global

107
Q

Protected visibility

A

Visible: class, package, subclasses

108
Q

Default visibility

A

Visible: class, package

109
Q

Private visibility

A

Visible only inside the class

110
Q

Accessor method

A

A method to return a value of a private data field

111
Q

Mutator method

A

A method to set a new value for a private data field

112
Q

Pass by sharing

A

The object referenced in the method is the same object as the one being passed

113
Q

Immutable object

A

An object whose contents cannot be changed once the object has been created

114
Q

Hidden variable

A

If a local variable has the same name as an instance variable, the local variable takes precedence

115
Q

This (keyword)

A

A name of a reference that the object can use to refer to itself

116
Q

Error signal

A

A code that specifies an exception with a value that is outside the valid value range (e.g. is negative)

117
Q

Try-catch block

A

An structure in which critical program instructions are contained in the try block and exceptions are handled in the catch block

118
Q

Throws (keyword)

A

A keyword that indicates in the method signature which exceptions can be thrown by the method

119
Q

Finally block

A

The block that contains statements that are executed independent of the occurrence of an exception

120
Q

Dynamic binding

A

The most suitable implementation will be selected by the runtime environment

121
Q

Use association

A

The association that indicates that a class uses an interface

122
Q

Class abstraction

A

A level of abstraction which separates a class implementation from how the class is used

123
Q

Procedural programming paradigm

A

Action driven; data is separated from actions

124
Q

Association

A

A general binary relationship that describes an activity between two classes

125
Q

Multiplicity

A

A number or an interval that specifies how many of the class’s objects are involved in the relationship

126
Q

Aggregation

A

A special form of association that represents an ownership relationship between two objects

127
Q

Composition

A

An existence of the aggregated object (subject) is dependent on the aggregating object (owner). Example: Name depends on Student

128
Q

Stack

A

A data structure that holds data in LIFO fashion

129
Q

Boxing

A

A conversion of a primitive value to a wrapper object

130
Q

Unboxing

A

A conversion of a wrapper object into a primitive data value

131
Q

Interned string

A

A unique instance for string literals with the same character sequence in order to improve efficiency and save memory

132
Q

Regular expression

A

A string that describes a pattern for matching a set of strings

133
Q

Synchronized

A

Only one task is allowed to execute the method

134
Q

Capacity of the string builder

A

A number of characters, that string builder is able to store without having to increase its size

135
Q

Subtype

A

A type defined by a subclass

136
Q

Supertype

A

A type defined by a superclass

137
Q

Multiple inheritance

A

The capability to derive a subclass from several classes

138
Q

Single inheritance

A

A class may inherit directly only from one superclass

139
Q

Constructor chaining

A

Constructing an instance of a class invokes the constructors of all superclasses along the inheritance chain

140
Q

@Override annotation

A

An annotation which denotes that the annotated method is required to override a method in its superclass. If the method is not overriden the compiler reports an error

141
Q

Declared type

A

A type that declares a variable

142
Q

Actual type

A

An actual class for the object referenced by a variable

143
Q

Implicit casting

A

Super obj = new Subclass()

144
Q

Explicit casting

A

subclass obj = (subsclass) super

145
Q

Upcasting

A

A casting of an instance of a subclass to a variable of a superclass

146
Q

Downcasting

A

A casting of an instance of a superclass to a variable of a subclass

147
Q

ClassCastException

A

An unchecked exception that is thrown if the superclass object is not instance of a subclass object.

148
Q

Exception

A

An object that represent an error or a condition that prevents execution from proceeding normally

149
Q

System error

A

An instance of the Error class, that represents an internal system error. Can’t be recovered

150
Q

Unchecked exception

A

A subsclass of a RuntimeException class, that describes programming errors

151
Q

Checked exception

A

A subclass of Exception class, that represent an error outside the control of the program (IO error etc.)

152
Q

Declaring exceptions

A

Every method should state types of checked exceptions it might throw

153
Q

Exception handler

A

Code that handles an exception

154
Q

Stack trace

A

A list of all methods in the call stack which provides valuable information for debugging runtime errors

155
Q

Chained exception

A

Throwing an exception along with another exception

156
Q

Try-with-resources

A

A construct that automatically closes resources. Resources should be an instance of AutoCloseable interface

157
Q

Interface

A

A class-like construct for defining common operations for objects

158
Q

Interface inheritance

A

A relationship between the class and the interface

159
Q

Default method

A

A method in an interface that provides a default implementation for the method

160
Q

Marker interface

A

An interface with an empty body

161
Q

Principle of cohesion

A

A class should describe a single entity, and class operations should logically fit together to support a coherent purpose

162
Q

Principle of clarity

A

A class should have a clear contract that is easy to explain and easy to understand

163
Q

Principle of completeness

A

A class should provide a variety of ways for customization through properties, methods, constructors