EXAM LATEST 2024-2025 QUESTIONS
WITH COMPLETE SOLUTIONS
Anticipating Values and Allocating Storage - Answer-Typing in a programming language
involves specifying the type of data that a variable can hold.
Valid and Applicable Operations - Answer-Different types of data support different
operations.
Compiler's Role - Answer-In the context of languages like Java, where variables have a
specific type, the compiler plays a crucial role.
Variable Declaration - Answer-Before you can use a variable, you need to declare it.
Declaration involves specifying the variable's type and name.
declare, Declaration - Answer-Before you can use a variable, you need to __ it. __
involves specifying the variable's type and name.
Variable Initialization - Answer-Initialization is the process of assigning an initial value to
a declared variable. Java requires variables to be initialized before they can be used.
Initialization, initial - Answer-__ is the process of assigning an __ value to a declared
variable. Java requires variables to be initialized before they can be used.
method - Answer-A __ definition that occurs in a class construct is made up of two
distinct portions: the method signature header and its implementation code body
surrounded by the braces { ... }.
method signature header and its implementation code body surrounded by the braces -
Answer-A method definition that occurs in a class construct is made up of two distinct
portions: the __ and its __ { ... }.
Object instantiation - Answer-__ in Java refers to the process of creating instances
(objects) of a class.
classes - Answer-In Object-Oriented Programming (OOP), __ serve as blueprints or
templates that define the structure and behavior of objects. When you instantiate a
class, you create a concrete instance of that class with its own set of attributes (fields)
and methods.
, Class Definition - Answer-You define a class with attributes (fields) and methods that
describe the behavior and properties of objects that will be created based on this class.
Creating Objects - Answer-To create an object of a class, you use the new keyword
followed by the class constructor. The constructor is a special method responsible for
initializing the newly created object.
Arithmetic Operator - Answer-The __ in Java include the common addition "+",
subtraction "-", multiplication "*" , modulus "%" and division "/" operations.
Logical Operators - Answer-The __ in Java include the standard and "&&", or "||" and
not "!".
true - Answer-&& returns true if both operands are __.
true - Answer-|| returns true if at least one operand is __.
false - Answer-! returns true if the single operand is __.
Relational Operators - Answer-The equality "==" and inequality "!=" operators in Java
operate on all values and objects to return a boolean result.
Less Than - Answer-<
Greater Than - Answer->
Less Than or Equal - Answer-<=
Greater Than or Equal - Answer->=
Assignment - Answer-Having seen the basic means of providing new values to
variables, assignment "=" is more correctly viewed as an operator rather than a
statement
Typecast - Answer-The __ operator (type)E performs 2 basic functions at run-time
depend int on the source expression E. For a numeric type (such as int, float, or
double), it converts the value to another of the specified type.
Local Variables, Instance Variables, and Static Variables - Answer-Three types of
variables in Java
Local Variables - Answer-A variable defined within a block or method or constructor is
called __.