Exam 6: Loops
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
What is the output of the code fragment given below?
Int i = 0;
Int j = 0;
While (i < 125)
{
I = i + 2;
J++;
}
System.out.println(j);
(Multiple Choice)
4.8/5
(32)
What is the output of the code below? for (int val = 0; val < 4; val ++)
{
System.out.print ("+");
For (int num = 0; num < val; num++)
{
System.out.print ("0");
}
}
(Multiple Choice)
4.9/5
(37)
Which loop does not check a condition at the beginning of the loop?
I. The do loop
II. The while loop
III. The for loop
(Multiple Choice)
4.7/5
(39)
How many times does the following code snippet display "Loop Execution"? for (int i = 0; i < 10; i++);
{
System.out.println("Loop Execution");
}
(Multiple Choice)
4.9/5
(40)
What does the following code do?
Int sum = 0;
Final double count = 1000;
Random generator = new Random();
For (int i = 1; i <= count; i++)
{
Sum = sum + generator.nextInt(101);
}
System.out.println(sum / count);
(Multiple Choice)
4.9/5
(41)
Which of the loop(s) test the condition after the loop body executes?
I. for loop
II. while loop
III. do loop
(Multiple Choice)
4.9/5
(39)
Assume the following variable has been declared and given a value as shown: Random rand = new Random();
Int number = rand.nextInt (27) * 2 + 3;
What are the smallest and largest values number may be assigned?
(Multiple Choice)
4.9/5
(37)
Showing 121 - 128 of 128
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)