Académique Documents
Professionnel Documents
Culture Documents
Creation of procedures.
Writing algorithms.
Correct Correct
True (*)
False
Correct Correct
True (*)
False
Correct Correct
True (*)
False
Correct Correct
True
False (*)
Correct Correct
6. During the Testing phase of software development, which of the following are
the tasks undertaken by the programmer? Mark for Review
(1) Points
Correct Correct
True (*)
False
Incorrect Incorrect. Refer to Section 2 Lesson 2.
8. Which two are the correct syntax for adding comments? Mark for
Review
(1) Points
Start with two slashes (//). End when the line ends. (*)
Start with two slashes (//). End with two slashes (//).
Start with two slashes and a star (//*). End with a star-slash (*/).
Correct Correct
True (*)
False
Correct Correct
Section 3
(Answer all questions in this section)
10. char is the primitive textual data type in Java. Mark for
Review
(1) Points
True (*)
False
Correct Correct
11. Which two statements compile? Mark for Review
(1) Points
Correct Correct
12. Which is the correct declaration for a char data type? Mark
for Review
(1) Points
Correct Correct
a=2
Correct Correct
14. Which two data types are appropriate for their variable? Mark
for Review
(1) Points
Correct Correct
Type casting retains the size of the value or the original data type.
Correct Correct
nt intVar1 = (int)"100";
Correct Correct
NumberFormatException (*)
ArithmeticException
NullPointerException
ValueNotFoundException
Correct Correct
True (*)
False
Correct Correct
20. The Scanner class accepts input in which form? Mark for Review
(1) Points
Integer
Callables
Tokens (*)
Future
Correct Correct
21. These two code fragments perform the same task.
// Fragment 1
String inputString = JOptionPane.showInputDialog("??");
int input = Integer.parseInt(inputString);
input++;
// Fragment 2
int input = Integer.parseInt(JOptionPane.showInputDialog("??")) + 1; Mark for
Review
(1) Points
True (*)
False
Correct Correct
Value of age: 20
Value of age: 8
Value of age: 10 (*)
Value of age: 20
Value of age: 28
Value of age: 38
Value of age: 20
Value of age: 208
Value of age: 20810
Value of age: 20
Value of age: 8
Value of age: 9
Correct Correct
23. What is the range of the byte data type? Mark for Review
(1) Points
�215 to 215�1
�231 to 231�1
�263 to 263�1
Correct Correct
True (*)
False
Correct Correct
Section 4
(Answer all questions in this section)
JavA World!
Java World!
JAva World!
Correct Correct
26. The indexOf() method returns the index value of a character in the string.
Mark for Review
(1) Points
True (*)
False
Correct Correct
True
False (*)
28. The String concat() method concatenates only String data types.
Mark for Review
(1) Points
True (*)
False
Correct Correct
import package.className;
One is the package name and the other is the classname. Mark for Review
(1) Points
True (*)
False
Correct Correct
30. Which of the following wild card character is used to import all
the classes in a particular package? Mark for Review
(1) Points
~
!
* (*)
Correct Correct
31. Import statements are placed above the class definition. Mark for Review
(1) Points
True (*)
False
Correct Correct
awt.font
java.awt.font (*)
java.awt
java
Correct Correct
33. The Math class methods can be called without creating an instance
of a Math object. Mark for Review
(1) Points
True (*)
False
Correct Correct
34. What is the package name which contains Math class? Mark for
Review
(1) Points
java.net
java.lang (*)
java.awt
java.io
Correct Correct
True (*)
False
Correct Correct
36. An argument is a value that's passed during a method call Mark for Review
(1) Points
True (*)
False
Correct Correct
37. Which of the following are the arguments in the following method?
emp
Correct Correct
3 (*)
Correct Correct
39. Which class is used to generate random numbers? Mark for Review
(1) Points
Double
Random (*)
Integer
Number
Correct Correct
nextInt(0-79);
nextInt(80);
nextInt();
nextInt(81); (*)
Correct Correct
36. An argument is a value that's passed during a method call Mark for Review
(1) Points
True (*)
False
Correct Correct
37. Which of the following are the arguments in the following method?
emp
Correct Correct
38. How many arguments does the following method accept?
3 (*)
Correct Correct
39. Which class is used to generate random numbers? Mark for Review
(1) Points
Double
Random (*)
Integer
Number
Correct Correct
nextInt(0-79);
nextInt(80);
nextInt();
nextInt(81); (*)
Correct Correct
41. You need to generate random integer values in the range 2 through 10. This
code fragment will produce the desired result.
True (*)
False
Correct Correct
Section 5
(Answer all questions in this section)
42. In the AND (&&) test, if the first expression on the left hand
side is false, then there is no need to evaluate the second statement. Mark for
Review
(1) Points
True (*)
False
Correct Correct
True (*)
False
Correct Correct
44. An employee is eligible for a bonus based on certain criteria.
Under what conditions does �Eligible for a bonus� print?
int rating;
int experience;
if (rating > 1 && experience == 5) {
System.out.println (�Eligible for a bonus�);
} Mark for Review
(1) Points
Correct Correct
45. The equal sign (=) is used to make an assignment, whereas the ==
sign merely makes a comparison and returns a boolean. Mark for Review
(1) Points
True (*)
False
Correct Correct
46. A String comparison with == compares the Strings� locations in memory and not
the content of the String. Mark for Review
(1) Points
True (*)
False
Correct Correct
Bob is 43 Bob is 50
Bob is 50
No output
Bob is 43 (*)
Correct Correct
Variables (*)
Loops
Operators (*)
Errors
True (*)
False
Correct Correct
50. Which two of the following data types can be used in a switch
statement? Mark for Review
(1) Points
boolean
String (*)
float
int (*)
Correct Correct