Exam 1: Review of Java Fundamentals
Exam 1: Review of Java Fundamentals60 Questions
Exam 2: Principles of Programming and Software Engineering60 Questions
Exam 3: Recursion: the Mirrors60 Questions
Exam 4: Data Abstraction: The Walls60 Questions
Exam 5: Linked Lists60 Questions
Exam 6: Problem Solving With Abstract Data Types60 Questions
Exam 7: Stacks60 Questions
Exam 8: Queues60 Questions
Exam 9: Advanced Java Topics60 Questions
Exam 10: Algorithm Efficiency and Sorting60 Questions
Exam 11: Trees60 Questions
Exam 12: Tables and Priority Queues60 Questions
Exam 13: Advanced Implementations of Tables60 Questions
Exam 14: Graphs60 Questions
Exam 15: External Methods30 Questions
Select questions type
If x is a variable of type int,what is the largest possible value of the expression (x % 5)?
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
B
If s = "hello,world" (with exactly one space between the comma and 'w'),what does s.indexOf(",")return?
Free
(Short Answer)
4.8/5
(35)
Correct Answer:
5
A statement invoking a constructor should also use the Java keyword ______.
Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
D
What does it mean for the return type of a method to be void?
(Multiple Choice)
4.7/5
(38)
What is wrong with this loop? How would you fix it?
int num = 1;
while (num <= 10){
System.out.println("num = " + num);
}
(Essay)
4.8/5
(34)
If d is a double and i is an int,then the assignment statement d = i;is legal in Java.
(True/False)
4.7/5
(34)
What is the meaning of the declaration: String [][] a = new String [60][80];?
(Multiple Choice)
4.8/5
(35)
When using the method System.out.printf( ),what is the purpose of the %d format code?
(Multiple Choice)
4.8/5
(39)
The following code attempts to find the sum of the elements in the third column (from the left)of a two dimensional int array called a that has 10 rows and 20 columns.Correct the errors in the code.
int sum = 0;
for (int i = 0;i < 20;i++)
sum = sum + a[3][i];
(Essay)
4.7/5
(38)
In Java,when we write an if-statement of the form if(condition),the condition must evaluate to a boolean value.
(True/False)
4.8/5
(45)
If s1 = "dog" and s2 = "cat",then s1.compareTo(s2)returns a positive integer value.
(True/False)
4.8/5
(38)
Suppose a,b and c are the lengths of the 3 sides of a triangle.Write an if-statement that will determine if the triangle is isosceles (at least 2 of the 3 sides are equal).You may assume that a,b and c are of type int.
(Essay)
4.7/5
(44)
Why does the Java statement System.out.println("answer = " + 3 + 4);
not print answer = 7 ?
(Essay)
4.9/5
(44)
Suppose s1 is a String variable.We want to check to see if the first and last characters of s1 are the same.Complete the following if-statement to accomplish the task.
boolean same;
if (______________________________________________)
same = true;
else
same = false;
(Short Answer)
4.9/5
(44)
Showing 1 - 20 of 60
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)