CSCI 2010 MIDTERM 2025|COMPLETE EXAM TEST (questions and
CSCI 2010 MIDTERM
verifiedStudy
answers) FREQUENTLY MOST TESTED QUESTIONS |already
online at https://quizlet.com/_8uw771
graded A+|100% passed!!
1. If you compile a java source file contain- MyApp.class
ing a definition of class called MyApp,
what is the name of the file that contains
the results
2. Given the code: 12
String greeting = "Hello there!";
System.out.println(greeting.length());
What is displayed to the screen?
3. Which of the following objects is used to System.out
display normal output to the screen?
4. Which of the following statements reads number = keyboard.nextInt();
a number from the keyboard?
5. Which of the following keywords is NOT void
required when declaring a named con-
stant?
final
void
public
static
6. The java compiler translates source code Bytecode
written in Java into which of the follow-
ing languages?
7. Which of the following is used to display System.out.printf
formatted output?
8. A class is a blueprint for creating objects
, CSCI 2010 MIDTERM
Study online at https://quizlet.com/_8uw771
What is the relationship between a class
and an object?
9. Which of the following statements does number + 1
NOT increase the value of the variable
number by 1?
number += 1
number + 1
number = number + 1
number ++
10. which of the following is the correct way s1.equals(s2)
to test if two strings s1 and s2 are exactly
the same?
11. What is the difference between a while A while loop evaluates its controlling boolean
loop and a do-while loop expression before the body is executed.
A do-while loop evaluates its controlling
boolean after the loop is executed
12. Why is it a good idea to use a DEBUG flag the DEBUG flag allows the programmer to easily
when tracing variables? turn the tracing messages on and off
13. What does the following code display? boing
boing
for (int i = 1; i <= 5; i ++ ) boing
if ( i == 4 )
break;
System.out.println("boing");
14. Which java type is used to represent a boolean
value of true or false?
CSCI 2010 MIDTERM
verifiedStudy
answers) FREQUENTLY MOST TESTED QUESTIONS |already
online at https://quizlet.com/_8uw771
graded A+|100% passed!!
1. If you compile a java source file contain- MyApp.class
ing a definition of class called MyApp,
what is the name of the file that contains
the results
2. Given the code: 12
String greeting = "Hello there!";
System.out.println(greeting.length());
What is displayed to the screen?
3. Which of the following objects is used to System.out
display normal output to the screen?
4. Which of the following statements reads number = keyboard.nextInt();
a number from the keyboard?
5. Which of the following keywords is NOT void
required when declaring a named con-
stant?
final
void
public
static
6. The java compiler translates source code Bytecode
written in Java into which of the follow-
ing languages?
7. Which of the following is used to display System.out.printf
formatted output?
8. A class is a blueprint for creating objects
, CSCI 2010 MIDTERM
Study online at https://quizlet.com/_8uw771
What is the relationship between a class
and an object?
9. Which of the following statements does number + 1
NOT increase the value of the variable
number by 1?
number += 1
number + 1
number = number + 1
number ++
10. which of the following is the correct way s1.equals(s2)
to test if two strings s1 and s2 are exactly
the same?
11. What is the difference between a while A while loop evaluates its controlling boolean
loop and a do-while loop expression before the body is executed.
A do-while loop evaluates its controlling
boolean after the loop is executed
12. Why is it a good idea to use a DEBUG flag the DEBUG flag allows the programmer to easily
when tracing variables? turn the tracing messages on and off
13. What does the following code display? boing
boing
for (int i = 1; i <= 5; i ++ ) boing
if ( i == 4 )
break;
System.out.println("boing");
14. Which java type is used to represent a boolean
value of true or false?