OSU CSE 2221 Final Review 65

CAREER EXAMS
Loading...

Loading study material viewer...

Page 0 of 0

Document Text

OSU CSE 2221 Final Review | 65 Questions with 100% Correct Answers | Verified | Latest Update

Question : The correct syntax for the "main" method signature

is:

  • private static void main(String[] args)
  • public static String main(String[] args)
  • public static void main(String[] args)
  • public void main(String[] args)
  • none of the above

Correct answer: c

Question : The Java compiler does the following:

  • checks a bytecode program in a ".class" file for run-time
  • errors and if there are none, it generates source code for that program in a ".java" file

  • checks a source code program in a ".java" file for run-time
  • errors and if there are none, it generates bytecode for that program in a ".class" file

  • checks a source code program in a ".java" file for compile-
  • time errors and, if there are none, it generates bytecode for that program in a ".class" file

  • checks a bytecode program in a ".class" file for compile-
  • time errors and if there are none, it generates source code for that program in a ".java" file

  • none of the above

Correct answer: c

Question : Which statement correctly defines a java constant?

  • const SPECIAL = 1234;
  • int SPECIAL = 1234;
  • int final SPECIAL = 1234;
  • final int SPECIAL = 1234;
  • const int SPECIAL = 1234;

Correct answer: d

Question : What is the value of s after the following

statement:

String s = (!true) + " : " + (10 + 4) + " is 104";

a. "!true : 104 is 104"

b. "false : 104 is 104"

c. "!true : 14 is 104"

d. "false : 14 is 104"

  • This is a compile-time error

Correct answer: d

Question : The Checkstyle plugin for Eclipse is useful

because:

  • it warns you of potential compile-time errors
  • it helps you make your code understandable for yourself
  • and other programmers

  • it prevents your code from making errors caught by assert
  • statements

  • it tells you when code you have written does not obey its
  • contract

  • none of the above

Correct answer: b

Question : If x is an int variable, when does the boolean

expression evaluate to true?

((x % 5 != 0) && (x % 2 != 0))

  • when x is divisible by 5 or by 2 but not by both
  • when x is divisible by 10
  • when x is not divisible by 10
  • when x is neither divisible by 5 nor by 2
  • when x is either divisible by 5 or by 2

Correct answer: d

Download Study Material

Buy This Study Material

$30.00
Buy Now
  • Immediate download after payment
  • Available in the pdf format
  • 100% satisfaction guarantee

Study Material Information

Category: CAREER EXAMS
Description:

OSU CSE 2221 Final Review | 65 Questions with 100% Correct Answers | Verified | Latest Update Question : The correct syntax for the "main" method signature is: a. private static void main(String[] ...

Purchase PDF $30.00