Debugging and Errors Flashcards

1
Q

This is an 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
2
Q

This are often remain undetected until the program is compiled or executed.

A

Programming Errors

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

True or False:
Some of the errors inhibit the program from getting compiled or executed.

A

True

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

True or False:
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
5
Q

This occur or we can say, are detected during the execution of the program.

A

Run Time Error

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

A Runtime Error can be discovered when the user enters an _______

A

Invalid Data

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

This occur when a program does not contain any syntax errors but asks the computer to of something that the computer is unable to reliable do.

A

Runtime Error

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

True or False:
During compilation, the compiler has no technique to detect a Runtime Error

A

True

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

What is the meaning of JVM?

A

Java Virtual Machine

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

This can detects the Runtime Error while the program is running.

A

Java Virtual Machine

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

How to handle the Runtime Error during a runtime?

A

Put the error code inside the try block and catch the error inside the catch block.

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

How to know if you are having a runtime error?

A
  1. if the user inputs a data of string format when the computer is expecting an integer, there will be a runtime error.
  2. Assigning/Retrieving Value from an array using an index which is greater than the size of the array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

These 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.

A

Compile Time Error

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

How can a Compile Time Error detected?

A

By the Java Compiler and an error message is displayed on the screen while compiling.

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

Compile Time Errors are sometimes also referred to as ____

A

Syntax Errors

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

These kind of errors are easy to spot and rectify, because the java compiler finds them for you.

A

Compile Time Error

17
Q

This will tell you which piece of code in the program got in trouble and its best guess as to what you did wrong.

A

The Compiler

18
Q

True or False:
The Compiler indicates the exact line where the error is, or sometimes the line just before it.

A

True, but if the problem is with incorrectly nested braces, the actual error may be at the beginning of the block. In effect, syntax errors represent grammatical errors in the use of the programming language.

19
Q

What are the examples of Compile Time Error?

A
  1. Misspelled Variable name or Method Names
  2. Missing Semicolons
  3. Missing parenthesis, square brackets, or curly braces
20
Q

This is 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

Logical Error

21
Q

True or False:
These errors are detected neither by the compiler nor by JVM.

A

True

22
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

23
Q

What are the examples of Logical Error?

A
  1. Accidentally using an incorrect operator on the variables to perform an operation
  2. Displaying the wrong message
24
Q

These statements are called loops, and are used to repeat the same code multiple times in succession.

A

Repetition Statements

25
Q

True or False:
The number of repetitions is based on criteria defined in the loop structure, usually a true/false expression

A

True

26
Q

What are the three loop structures in Java?

A
  1. While Loops
  2. Do-while Loops
  3. For Loops
27
Q

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

A

Boolean Expression

28
Q

In a Boolean expression, this means run the loop body again.

A

True

29
Q

In a Boolean expression, this means quit.

A

False

30
Q

These both follow the same basic flowchart.

A

While and Do-While Loop

31
Q

The only exception in this loop is that the test expression is checked first

A

While Loop

32
Q

The only exception in this loop is that the loop “body” is executed first

A

Do-while Loop

33
Q

This is the most convenient with counting loops. This loops are based on a counting variable, usually a known number of iterations.

A

For loop