Computer Science Test Questions and
Correct Answers 2025-2026 Latest
Edition.
PrintWriter - ANS -What is used for writing output to a file?
scanner - ANS -What is used when getting input from a file?
scanner - ANS -Which of the following is not a primitive data type?
float
long
Scanner
char
/n - ANS -Which of the following is an example of an escape sequence?
/n
while
main
Scanner
count == 1 - ANS -Which of the following does not change the value of a variable?
count++
count == 1
count += 1
, count = 1
count = count + 1
Math.pow - ANS -Which of the following should you use to compute the value that results when
raising one variable to the power of another (i.e, exponentiation)?
Math.pow
Math.random
**
++
^
none
ok will always be printed - ANS -if( firstletter != 'y' || firstletter != 'Y') System.out.println ( "ok" );
Which of the following true:
ok will always be printed
ok will never be printed
ok will be printed only when firstletter is neither 'y' nor 'Y'
the value of firstletter will be printed only if it has the value 'n'
none
TestQuestion.java - ANS -Suppose you implement a class with the header
// public class TestQuestion
The java source code for the class is stored in a file with the name:
19 - ANS -How many times will the body of the loop execute?
Correct Answers 2025-2026 Latest
Edition.
PrintWriter - ANS -What is used for writing output to a file?
scanner - ANS -What is used when getting input from a file?
scanner - ANS -Which of the following is not a primitive data type?
float
long
Scanner
char
/n - ANS -Which of the following is an example of an escape sequence?
/n
while
main
Scanner
count == 1 - ANS -Which of the following does not change the value of a variable?
count++
count == 1
count += 1
, count = 1
count = count + 1
Math.pow - ANS -Which of the following should you use to compute the value that results when
raising one variable to the power of another (i.e, exponentiation)?
Math.pow
Math.random
**
++
^
none
ok will always be printed - ANS -if( firstletter != 'y' || firstletter != 'Y') System.out.println ( "ok" );
Which of the following true:
ok will always be printed
ok will never be printed
ok will be printed only when firstletter is neither 'y' nor 'Y'
the value of firstletter will be printed only if it has the value 'n'
none
TestQuestion.java - ANS -Suppose you implement a class with the header
// public class TestQuestion
The java source code for the class is stored in a file with the name:
19 - ANS -How many times will the body of the loop execute?