4 pillars Flashcards

1
Q

This is to make sure that “sensitive” data is hidden from users.

A

Encapsulation

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

Ways to do encapsulation

A

Declare a Class variables/attributes as private
Provide public get and set methods to access and update the value of a private.

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

Creating new classes based on existing ones.

A

Inheritance

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

the class that inherits from another class

A

subclass (child)

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

the class being inherited.

A

superclass(parent)

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

Allows us to perform a single action in different ways.

A

Polymorphism

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

is the process of hiding certain details and showing only essential information to the user.

A

Abstraction

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

is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class).

A

abstract class

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

can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from).

A

abstract method

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

illegal operation performed by the user which results in the abnormal working of the program

A

error

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

true or false:
Programming errors often remain undetected until the program is compiled or executed

A

true

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

true or false: Some of the errors inhibit the program from getting compiled or executed. Thus errors should be removed before compiling and executing.”

A

true

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

are detected during the execution of the program. Sometimes these are discovered when the user enters an invalid data or data which is not relevant

A

run time errors

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

True or false: Runtime errors occur when a program does not contain any syntax errors but asks the computer to do something that the computer is unable to reliably do.During compilation, the compiler has no technique to detect these kinds of errors.

A

true

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

detects it while the program is running.

A

Java virtual machine

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

true or false: To handle the error during the run time we can put our error code inside the try block and catch the error inside the catch block.

A

true

17
Q

are those errors which prevent the code from running because of an incorrect syntax such as a missing semicolon at the end of a statement or a missing bracket, class not found, etc. These errors are detected by the java compiler and an error message is displayed on the screen while compiling

A

Compile Time Errors

18
Q

Compile Time Errors are sometimes also referred to as

A

Syntax Error

19
Q

True or False: Compile Time errors are easy to spot and rectify because the java compiler finds them for you. The compiler will tell you which piece of code in the program got in trouble and its best guess as to what you did wrong. Usually, the compiler indicates the exact line where the error is, or sometimes the line just before it, however, if the problem is with incorrectly nested braces, the actual error may be at the beginning of the block.

A

True

20
Q

What does syntax error represent in the use of programming?

A

Grammatical errors

20
Q

true or false: Misspelled variable name or method names is one of the examples of compile time errors

A

true

21
Q
A
22
Q

true or false : Missing semicolons is one of the examples of compile time errors.

A

true

23
Q

true or false: Missing parenthesis, square brackets, or curly braces is not one of the example of compile time errors.

A

false, it is one of the example of compile time errors

24
Q

When your program compiles and executes, but does the wrong thing or returns an incorrect result or no output when it should be returning an output.

A

Logic Error

25
Q

true or false: The Java system has no idea what your program is supposed to do, so it provides no additional information to help you find the error.

A

true

26
Q

true or false:Accidentally using an incorrect operator on the variables to perform an operation (Using ‘/’ operator to get the modulus instead using ‘%’) in one of the examples of logic error

A

true

27
Q

true or false: Displaying the wrong message is one of the examples of logic error

A

true

28
Q

What do we call in repetition statements?

A

loops

29
Q

are used to repeat the same code multiple times in succession.

A

loops

30
Q

three loop structures in Java

A
  • while loops
  • do-while loops
  • for loops
31
Q

true or false:Three types of loops are not actually needed, but having the different forms is convenient

A

true

32
Q

is a test condition that is evaluated to decide whether the loop should repeat or not.

A

boolean expression

33
Q

means run the loop body again.

A

true

34
Q

means quit in loop

A

false

35
Q

true or false: Thewhileanddo/whileloops both follow the same basic flowchart

A

true

36
Q

, the test expression is checked first

A

while loop

37
Q

the loop “body” is executed first

A

do/while loop

38
Q
A