SECTIONA: TRUEOR FALSE
This section consist of 20 questions. Answer all the questions
Each correct answer is allocated 2 Marks
Write True or False for Questions 1 to 20.
1. It is compulsory to insert package in a Java program on VPL elearning.
[2 Marks]
2. Every Java program requires at least one class
[2 Marks]
3. In Java, the following statements are allowed: System.out.println(); or
System.out.print(); or System.out.printf();
[2 Marks]
4. Once an Array is declared, the size cannot be changed.
[2 Marks]
5. An Array can store only values of the same type
[2 Marks]
6. print() - prints string inside the bracket and the cursor moves to the
beginning of the next line
[2 Marks]
7. In Java, the keywords: main, Main, and mAin are the same
[2 Marks]
8. A variable is a location in the library to hold data.
[2 Marks]
9. This statement should be declared as char strl = "Java Programming";
[2 Marks]
10. The statement: /(7 = Ml/Nl * N2 is the same as 1<7= Ml/nl *n2
[2 Marks]
11. You can pass data, known as parameters, into a method.
[2 Marks]
12. scanner9 is a valid variable name.
[2 Marks]
13. The output of {8*2)/4-1 using precedence operator rule is: 9
[2 Marks]
14. In java the statement int loge is a valid statement
[2 Marks]
15. Every Java source file must bear the same name with the package and the
same name with the public class
[2 Marks]
16. Division by O or out of range array is an example of exception handling
[2 Marks]
17. The statement
double difference== numl - num2 is valid
[2 Marks]
18. int[] numsl= { 1, 2, -2, 3, 4, 5, 6} declares an integer array with the following
elements: 1, 2, -2, 3, 4, 5, 6
[2 Marks]
19. In Java, the identifiers DSEstudent, DSEStudent and DSEsTudent are all the same. [2 Marks]
20. Student_Mark is a Java keyword
[2 Marks]
SECTIONB: FILLTHE GAP
Copy and complete the table below.
Question Data Type
Value
Number
1
80.5
2
D
3
True
4
25003453.902
5
"Distinction
Student!"
6
21
Example of declarations
and assignment
Marks
[2 Marks]
[2 Marks]
[2 Marks]
[2 Marks]
[2 Marks]
[2 Marks]
2