EXAM SCRIPT FINAL PAPER 2026
COMPLETE SOLVED QUESTIONS
ALGORITHMS AND DATA STRUCTURES
INSIGHT TOOLKIT
◉ int n1 = 12;
int n2 = 5;
int n3 = ++n1 - n1--;
What is the result of the code above?
Answer: n3 = 8 and n2 = 4 and n1 = 13
◉ Identify the statements that correctly increase the variable
amount by 2. Select ALL that apply.
Answer: Amount += 2;
Amount = amount + 2;
◉ Identify the components of object-oriented programming in Java.
Select ALL that apply.
Answer: Encapsulation
,Inheritance
Abstraction
Polymorphism
◉ Identify the "blueprint" from which individual Java objects are
created.
Answer: Class
◉ This contains the JVM and Java Class Library.
Answer: JRE
◉ Simple data types for storing integers, real numbers, characters
and Booleans are called ____?____ in Java.
Answer: primitives
◉ int result = ;
What is the result of the code above?
Answer: 0 is stored in result
◉ long loan = 1234;
int number = loan;
,The code above does not compile. How could the code be corrected?
Select ALL that apply.
Answer: Add a cast to long
Add a cast to int
◉ Identify the correct Java variable assignment statements. Select
ALL that apply.
Answer: int bin = 0b111;
double cost = 2_345.5_;
double num - 1_00_0.0_0;
◉ Identify the correct Java statement(s). Select ALL that apply.
Answer: float taxRate = 0.07F;
float taxRate = 0.07f;
◉ Which of these technologies runs on the client side (in the
browser)? Select ALL that apply.
Answer: Applets
◉ Which package must be imported to create an instance of the
Scanner class?
Answer: java.util
, ◉ Identify the Java package that is never imported.
Answer: java.lang
◉ Java's thousands of classes are organized into ___?___
Answer: Packages
◉ Identify the correct use of comments. Select ALL that apply.
Answer: a. // this is a Java comment
b. System.out.println("Hello, World"); // say Hello
c. /* This is a Java comment */
◉ Identify the correct statements. Select ALL that apply.
Answer: a. A Java string is enclosed by double quotes
b. Java programs start in the main method.
c. The contents of a class are enclosed by curly braces ()
d. A compiled Java filename has a .class extension.
◉ A device needs a ____ to run a Java program
Answer: JVM
◉ Identify the true statements about Java. Select ALL that apply.
Answer: a. Java is case-sensitive