Deck 4: Loops and Files

ملء الشاشة (f)
exit full mode
سؤال
What will be the values of x and y as a result of the following code? int x = 25, y = 8;
X += y++;

A) x = 25, y = 8
B) x = 33, y = 8
C) x = 33, y = 9
D) x = 34, y = 9
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
____________ is the process of inspecting data given to the program by the user and determining if it is valid.

A) Data parsing
B) Input validation
C) User authentication
D) Defensive coding
سؤال
What will be the value of x after the following code is executed? int x = 10;
While (x < 100)
{
X += 10;
}

A) 90
B) 100
C) 110
D) This is an infinite loop
سؤال
Each repetition of a loop is known as what?

A) An iteration
B) A cycle
C) An execution
D) A Lap
سؤال
How many times will the following do-while loop be executed? int x = 11;
Do
{
X += 20;
} while (x > 100);

A) 0
B) 1
C) 4
D) 5
سؤال
This type of loop will always be executed at least once.

A) pre-test loop
B) post-test loop
C) sentinel loop
D) for loop
سؤال
What will be the value of x after the following code is executed? int x, y = 4, z = 6;
X = (y++) * (++z);

A) 24
B) 28
C) 30
D) 35
سؤال
If a loop does not contain within itself a way to terminate, it is called a(n)

A) while loop
B) do-while loop
C) for loop
D) infinite loop
سؤال
What will be the value of x after the following code is executed? int x = 10;
Do
{
X *= 20;
}
While (x > 5);

A) 10
B) 200
C) This is an infinite loop.
D) The loop will not be executed, the initial value of x > 5.
سؤال
This is a control structure that causes a statement or group of statements to repeat.

A) Block
B) Loop
C) Prefix mode
D) Body
سؤال
A loop that repeats a specific number of times is known as a(n)

A) sentinel loop
B) conditional loop
C) counter-controlled loop
D) infinite loop
سؤال
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 && number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100 or greater than 500
B) Numbers in the range 100 - 499
C) Numbers in the range 100 - 500
D) The boolean condition can never be true
سؤال
This type of loop allows the user to decide the number of iterations.

A) Counter-controlled loop
B) Dynamically executed loop
C) User controlled loop
D) Infinite loop
سؤال
What will be the value of x after the following code is executed? int x = 10, y = 20;
While (y < 100)
{
X += y;
}

A) 90
B) 110
C) 210
D) This is an infinite loop
سؤال
How many times will the following for loop be executed? for (int count = 10; count <= 21; count++)
System.out.println("Java is great!!!");

A) 1
B) 10
C) 12
D) 0
سؤال
This variable controls the number of times that the loop iterates.

A) Counter variable
B) Loop control variable
C) Running total
D) Decrement variable
سؤال
The increment operator is:

A) ++
B) --
C) *=
D) -=
سؤال
This is a value that signals when the end of a list of values has been reached.

A) Terminal value
B) Final value
C) End value
D) Sentinel
سؤال
If you are using a block of statements, don't forget to enclose all of the statements in a set of:

A) Braces
B) Double quotes
C) Semicolons
D) Parentheses
سؤال
What will be the value of x after the following code is executed? int x = 10;
For (int y = 5; y < 20; y +=5)
X += y;

A) 40
B) 25
C) 30
D) Invalid for statement
سؤال
Which of the following will open a file named MyFile.txt and allow you to append data to its existing contents?

A) FileWriter fwriter = new FileWriter("MyFile.txt", true);
PrintWriter outFile = new PrintWriter(fwriter);
B) FileWriter fwriter = new FileWriter("MyFile.txt");
PrintWriter outFile = new PrintWriter(fwriter);
C) PrintWriter outfile = new PrintWriter("MyFile.txt", true);
D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt");
سؤال
When using the PrintWriter class, which of the following import statements would you write near the top of your program?

A) import javax.swing.*;
B) import java.io.*;
C) import PrintWriter;
D) import java.file.*;
سؤال
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 || number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100
B) Numbers greater than 500
C) Numbers in the range 100 - 499
D) Numbers in the range 100 - 500
سؤال
What will be the value of x after the following code is executed? int x, y = 15, z = 3;
X = (y--) / (++z);

A) 3
B) 4
C) 5
D) 6
سؤال
Before entering a loop to compute a running total, the program should first do this.

A) Read all the values into main memory
B) Set the accumulator where the total will be kept to an initial value, usually zero
C) Know exactly how many values there are to total
D) Set all variables to zero
سؤال
This type of loop is ideal in situations where the exact number of iterations is known.

A) while loop
B) do-while loop
C) for loop
D) if statement
سؤال
Which of the following are pre-test loops?

A) while, for, do-while
B) while, do-while
C) while, for
D) for, do-while
سؤال
A for loop normally performs which of these steps?

A) initializes a control variable to a starting value
B) tests the control variable by comparing it to a maximum/minimum value and terminate when the variable reaches that value
C) updates the control variable during each iteration
D) all of the above
E) None of the above
سؤال
What will be the value of x after the following code is executed? int x = 10;
While (x < 100);
{
X += 10;
}

A) 90
B) 100
C) 110
D) This is an infinite loop
سؤال
What will be the value of x after the following code is executed? int x = 10, y = 20;
While (y < 100)
{
X += y;
Y += 20;
}

A) 90
B) 110
C) 130
D) 210
سؤال
How many times will the following do-while loop be executed? int x = 11;
Do
{
X += 20;
}
While (x <= 100);

A) 1
B) 3
C) 4
D) 5
سؤال
Given the following statement, which statement will write "Calvin" to the file DiskFile.txt? PrintWriter diskOut = new PrintWriter("DiskFile.txt");

A) System.out.println(diskOut, "Calvin");
B) DiskFile.println("Calvin");
C) PrintWriter.println("Calvin");
D) diskOut.println("Calvin");
سؤال
A sentinel value _________ and signals that there are no more values to be entered.

A) is a different data type than the values being processed
B) is a special value that cannot be mistaken as a member of the list
C) indicates the start of a list
D) guards the list
سؤال
Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops shows the correct way to read data from the file until the end of the file is reached?

A) while (inputFile != null)
{ … }
B) while (!inputFile.EOF)
{ … }
C) while (inputFile.hasNext())
{ … }
D) while (inputFile.nextLine == " ")
{ … }
سؤال
In all but rare cases, loops must contain within themselves

A) arithmetic statements
B) if statements
C) a way to terminate
D) nested loops
سؤال
What will be the values of x and y as a result of the following code? int x = 12, y = 5;
X += y--;

A) x = 12, y = 5
B) x = 16, y = 4
C) x = 17, y = 5
D) x = 17, y = 4
سؤال
What will be the value of x after the following code is executed? int x = 10;
Do
{
X *= 20;
}
While (x < 5);

A) 10
B) 200
C) This is an infinite loop.
D) The loop will not be executed, the initial value of x > 5.
سؤال
This is a sum of numbers that accumulates with each iteration of a loop.

A) Running total
B) Final total
C) Grand finale
D) Galloping total
سؤال
What will be printed after the following code is executed? for (int number = 5; number <= 15; number +=3)
System.out.print(number + ", ");

A) 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
B) 5, 8, 11, 14, 17,
C) 5, 8, 11, 14,
D) This is an invalid for statement
سؤال
A loop that executes as long as a particular condition exists is called a(n)

A) sentinel loop
B) conditional loop
C) count-controlled loop
D) infinite loop
سؤال
Assuming that inputFile references a Scanner object that was used to open a file, which of the following statements will read an int from the file?

A) int number = inputFile.nextInt();
B) int number = inputFile.next();
C) int number = inputFile.readInt();
D) int number = inputFile.integer();
سؤال
This is an item that separates other items.

A) Controller
B) Partition
C) Doorway
D) Delimiter
سؤال
This type of loop is ideal in situations where you always want the loop to iterate at least once.

A) while loop
B) do-while loop
C) for loop
D) if statement
سؤال
Which of the following will open a file named MyFile.txt and allow you to read data from it?

A) File file = new File("MyFile.txt");
B) Scanner inputFile = new Scanner("MyFile.txt");
C) File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);
D) PrintWriter inputFile = new PrintWriter("MyFile.txt");
سؤال
Java provides a set of simple unary operators designed just for incrementing and decrementing variables.
سؤال
When you open a file with the PrintWriter class, the class can potentially throw an IOException.
سؤال
When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
سؤال
The do-while loop must be terminated with a semicolon.
سؤال
The while loop has two important parts: (1) a boolean expression that is tested for a true or false value, and (2) a statement or block of statements that is repeated as long as the expression is true.
سؤال
A file must always be opened before using it and closed when the program is finished using it.
سؤال
The do-while loop is a pre-test loop.
سؤال
You can use the PrintWriter class to open a file for writing and write data to it.
سؤال
In the for loop, the control variable cannot be initialized to a constant value and tested against a constant value.
سؤال
When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
سؤال
In a for statement, the control variable can only be incremented.
سؤال
When you pass the name of a file to the PrintWriter constructor, and the file already
exists, it will be erased and a new empty file with the same name will be created.
سؤال
You can use this method to determine whether a file exists.

A) The Scanner class's exists method
B) The File class's exists method
C) The File class's canOpen method
D) The PrintWriter class's fileExists method
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/57
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Loops and Files
1
What will be the values of x and y as a result of the following code? int x = 25, y = 8;
X += y++;

A) x = 25, y = 8
B) x = 33, y = 8
C) x = 33, y = 9
D) x = 34, y = 9
C
2
____________ is the process of inspecting data given to the program by the user and determining if it is valid.

A) Data parsing
B) Input validation
C) User authentication
D) Defensive coding
B
3
What will be the value of x after the following code is executed? int x = 10;
While (x < 100)
{
X += 10;
}

A) 90
B) 100
C) 110
D) This is an infinite loop
B
4
Each repetition of a loop is known as what?

A) An iteration
B) A cycle
C) An execution
D) A Lap
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
5
How many times will the following do-while loop be executed? int x = 11;
Do
{
X += 20;
} while (x > 100);

A) 0
B) 1
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
6
This type of loop will always be executed at least once.

A) pre-test loop
B) post-test loop
C) sentinel loop
D) for loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
7
What will be the value of x after the following code is executed? int x, y = 4, z = 6;
X = (y++) * (++z);

A) 24
B) 28
C) 30
D) 35
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
8
If a loop does not contain within itself a way to terminate, it is called a(n)

A) while loop
B) do-while loop
C) for loop
D) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
9
What will be the value of x after the following code is executed? int x = 10;
Do
{
X *= 20;
}
While (x > 5);

A) 10
B) 200
C) This is an infinite loop.
D) The loop will not be executed, the initial value of x > 5.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
10
This is a control structure that causes a statement or group of statements to repeat.

A) Block
B) Loop
C) Prefix mode
D) Body
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
11
A loop that repeats a specific number of times is known as a(n)

A) sentinel loop
B) conditional loop
C) counter-controlled loop
D) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
12
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 && number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100 or greater than 500
B) Numbers in the range 100 - 499
C) Numbers in the range 100 - 500
D) The boolean condition can never be true
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
13
This type of loop allows the user to decide the number of iterations.

A) Counter-controlled loop
B) Dynamically executed loop
C) User controlled loop
D) Infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
14
What will be the value of x after the following code is executed? int x = 10, y = 20;
While (y < 100)
{
X += y;
}

A) 90
B) 110
C) 210
D) This is an infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
15
How many times will the following for loop be executed? for (int count = 10; count <= 21; count++)
System.out.println("Java is great!!!");

A) 1
B) 10
C) 12
D) 0
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
16
This variable controls the number of times that the loop iterates.

A) Counter variable
B) Loop control variable
C) Running total
D) Decrement variable
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
17
The increment operator is:

A) ++
B) --
C) *=
D) -=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
18
This is a value that signals when the end of a list of values has been reached.

A) Terminal value
B) Final value
C) End value
D) Sentinel
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
19
If you are using a block of statements, don't forget to enclose all of the statements in a set of:

A) Braces
B) Double quotes
C) Semicolons
D) Parentheses
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
20
What will be the value of x after the following code is executed? int x = 10;
For (int y = 5; y < 20; y +=5)
X += y;

A) 40
B) 25
C) 30
D) Invalid for statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
21
Which of the following will open a file named MyFile.txt and allow you to append data to its existing contents?

A) FileWriter fwriter = new FileWriter("MyFile.txt", true);
PrintWriter outFile = new PrintWriter(fwriter);
B) FileWriter fwriter = new FileWriter("MyFile.txt");
PrintWriter outFile = new PrintWriter(fwriter);
C) PrintWriter outfile = new PrintWriter("MyFile.txt", true);
D) PrintWriter outfile = new PrintWriter(true, "MyFile.txt");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
22
When using the PrintWriter class, which of the following import statements would you write near the top of your program?

A) import javax.swing.*;
B) import java.io.*;
C) import PrintWriter;
D) import java.file.*;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
23
In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.in);
System.out.print("Enter a number: ");
Int number = keyboard.nextInt();
While (number < 100 || number > 500)
{
System.out.print("Enter another number: ");
Number = keyboard.nextInt();
}

A) Numbers less than 100
B) Numbers greater than 500
C) Numbers in the range 100 - 499
D) Numbers in the range 100 - 500
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
24
What will be the value of x after the following code is executed? int x, y = 15, z = 3;
X = (y--) / (++z);

A) 3
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
25
Before entering a loop to compute a running total, the program should first do this.

A) Read all the values into main memory
B) Set the accumulator where the total will be kept to an initial value, usually zero
C) Know exactly how many values there are to total
D) Set all variables to zero
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
26
This type of loop is ideal in situations where the exact number of iterations is known.

A) while loop
B) do-while loop
C) for loop
D) if statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following are pre-test loops?

A) while, for, do-while
B) while, do-while
C) while, for
D) for, do-while
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
28
A for loop normally performs which of these steps?

A) initializes a control variable to a starting value
B) tests the control variable by comparing it to a maximum/minimum value and terminate when the variable reaches that value
C) updates the control variable during each iteration
D) all of the above
E) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
29
What will be the value of x after the following code is executed? int x = 10;
While (x < 100);
{
X += 10;
}

A) 90
B) 100
C) 110
D) This is an infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
30
What will be the value of x after the following code is executed? int x = 10, y = 20;
While (y < 100)
{
X += y;
Y += 20;
}

A) 90
B) 110
C) 130
D) 210
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
31
How many times will the following do-while loop be executed? int x = 11;
Do
{
X += 20;
}
While (x <= 100);

A) 1
B) 3
C) 4
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
32
Given the following statement, which statement will write "Calvin" to the file DiskFile.txt? PrintWriter diskOut = new PrintWriter("DiskFile.txt");

A) System.out.println(diskOut, "Calvin");
B) DiskFile.println("Calvin");
C) PrintWriter.println("Calvin");
D) diskOut.println("Calvin");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
33
A sentinel value _________ and signals that there are no more values to be entered.

A) is a different data type than the values being processed
B) is a special value that cannot be mistaken as a member of the list
C) indicates the start of a list
D) guards the list
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
34
Assume that inputFile references a Scanner object that was used to open a file. Which of the following while loops shows the correct way to read data from the file until the end of the file is reached?

A) while (inputFile != null)
{ … }
B) while (!inputFile.EOF)
{ … }
C) while (inputFile.hasNext())
{ … }
D) while (inputFile.nextLine == " ")
{ … }
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
35
In all but rare cases, loops must contain within themselves

A) arithmetic statements
B) if statements
C) a way to terminate
D) nested loops
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
36
What will be the values of x and y as a result of the following code? int x = 12, y = 5;
X += y--;

A) x = 12, y = 5
B) x = 16, y = 4
C) x = 17, y = 5
D) x = 17, y = 4
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
37
What will be the value of x after the following code is executed? int x = 10;
Do
{
X *= 20;
}
While (x < 5);

A) 10
B) 200
C) This is an infinite loop.
D) The loop will not be executed, the initial value of x > 5.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
38
This is a sum of numbers that accumulates with each iteration of a loop.

A) Running total
B) Final total
C) Grand finale
D) Galloping total
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
39
What will be printed after the following code is executed? for (int number = 5; number <= 15; number +=3)
System.out.print(number + ", ");

A) 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
B) 5, 8, 11, 14, 17,
C) 5, 8, 11, 14,
D) This is an invalid for statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
40
A loop that executes as long as a particular condition exists is called a(n)

A) sentinel loop
B) conditional loop
C) count-controlled loop
D) infinite loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
41
Assuming that inputFile references a Scanner object that was used to open a file, which of the following statements will read an int from the file?

A) int number = inputFile.nextInt();
B) int number = inputFile.next();
C) int number = inputFile.readInt();
D) int number = inputFile.integer();
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
42
This is an item that separates other items.

A) Controller
B) Partition
C) Doorway
D) Delimiter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
43
This type of loop is ideal in situations where you always want the loop to iterate at least once.

A) while loop
B) do-while loop
C) for loop
D) if statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
44
Which of the following will open a file named MyFile.txt and allow you to read data from it?

A) File file = new File("MyFile.txt");
B) Scanner inputFile = new Scanner("MyFile.txt");
C) File file = new File("MyFile.txt");
Scanner inputFile = new Scanner(file);
D) PrintWriter inputFile = new PrintWriter("MyFile.txt");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
45
Java provides a set of simple unary operators designed just for incrementing and decrementing variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
46
When you open a file with the PrintWriter class, the class can potentially throw an IOException.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
47
When the continue statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
48
The do-while loop must be terminated with a semicolon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
49
The while loop has two important parts: (1) a boolean expression that is tested for a true or false value, and (2) a statement or block of statements that is repeated as long as the expression is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
50
A file must always be opened before using it and closed when the program is finished using it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
51
The do-while loop is a pre-test loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
52
You can use the PrintWriter class to open a file for writing and write data to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
53
In the for loop, the control variable cannot be initialized to a constant value and tested against a constant value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
54
When the break statement is encountered in a loop, all the statements in the body of the loop that appear after it are ignored, and the loop prepares for the next iteration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
55
In a for statement, the control variable can only be incremented.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
56
When you pass the name of a file to the PrintWriter constructor, and the file already
exists, it will be erased and a new empty file with the same name will be created.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
57
You can use this method to determine whether a file exists.

A) The Scanner class's exists method
B) The File class's exists method
C) The File class's canOpen method
D) The PrintWriter class's fileExists method
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.