Computer Knowledge
Programming Fundamentals
2,611 Questions
Programming fundamentals form the core logic of software development and computer science. This includes variable declarations, pointer assignments, loop iterations, and exception handling. These technical topics are regularly tested in computer knowledge and IT officer competitive examinations.
Variables and arraysPointer assignmentsLoop iterationsException handling blocksCompile time errorsFunction references
Programming Fundamentals Questions
-
depends
-
include
-
pre-target
-
none of the above
A
Correct answer
Explanation
In Ant build tool, the 'depends' attribute of a target specifies which other targets must execute before the current target. These dependent targets are referred to as pre-targets and are executed in the order they are listed in the depends attribute.
-
A new type of Applet
-
A segment of code to be run a specified amount of times
-
A segment of code to be run infinite times
-
A segment of code to be run once
B
Correct answer
Explanation
A loop is a programming construct that repeats a block of code multiple times based on a condition or counter. It allows efficient execution of repetitive tasks without writing the same code repeatedly. Option A is incorrect as loops are not applets. Option C describes infinite loops which are a special case not the general definition.
-
name=
-
name=''
-
name=""
-
all of the above
D
Correct answer
Explanation
All three methods set a variable to null/empty: name= (no value), name='' (empty single quotes), name="" (empty double quotes). In shell scripting, these all result in an empty string value, effectively NULL.
-
while
-
for
-
until
-
none of the above
C
Correct answer
Explanation
The until loop executes its body as long as the condition is false. This is the inverse of a while loop, which runs while the condition is true. until keeps iterating until the condition becomes true.
A
Correct answer
Explanation
Local variables in transform functions have scope limited to each function call. They are reinitialized every time the transform function is invoked, ensuring clean state for each record processed unlike static or global variables.
A
Correct answer
Explanation
The jRules syntax shown is valid. A ruleset can contain a flowtask with a switch statement that includes case blocks and a default block. The structure follows proper jRules syntax with ruleset declaration, flowtask definition, and body containing the switch-case construct.
-
INPUT
-
OUTPUT
-
FAULT
-
None of the above
C
Correct answer
Explanation
In WSDL, the FAULT operation element captures errors that occur during web service execution. Each operation can have INPUT (request), OUTPUT (response), and FAULT (error) message definitions. Faults provide a standardized way to communicate error information back to the client.
A
Correct answer
Explanation
JavaScript does allow inner (nested) functions - functions can be defined inside other functions. This is a fundamental feature that enables closures, where inner functions retain access to variables in their outer function's scope even after the outer function returns.
A
Correct answer
Explanation
JavaScript functions absolutely can return values using the return statement. This is a fundamental feature - functions can compute and return results, return objects, return other functions (closures), or return undefined implicitly if no return statement is reached.
-
Free
-
Release
-
DisAssociate
-
Nothing
D
Correct answer
Explanation
In VBScript, object variables are references to actual objects in memory. To dissociate an object variable and release memory, you set the variable to 'Nothing' using the 'Set' keyword. This is different from other languages that use explicit 'Release' or 'Free' commands. The 'Nothing' keyword represents the absence of an object reference.
B
Correct answer
Explanation
Local variables defined in a shell script or session are restricted to the current shell instance. They are not inherited by child processes unless they are explicitly exported to the environment using the export command, making the statement false.
B
Correct answer
Explanation
A driver is a test component that calls the function being tested with test data and verifies results. Stubs simulate called components (not the one under test). Drivers are used for unit testing of functions/methods.
-
Testing Plan
-
Error handler
-
IPO Cycle
-
Input-Output Specification
A
Correct answer
Explanation
The Testing Plan is the component of a problem statement that provides specific test cases with sample inputs and expected outputs. This validates whether the implemented program works correctly. Error handlers are code modules, IPO Cycle is a concept, and Input-Output Specification is similar but Testing Plan is the standard term.
A
Correct answer
Explanation
Strings in Java are immutable - once created, their values cannot change. Methods like concat(), substring(), or toUpperCase() return new String objects rather than modifying the original. This design enables string interning and thread safety.
A
Correct answer
Explanation
An Assignment in PEGA is precisely defined as a task that requires user input and interaction. When created, an assignment can be routed to either an individual user's worklist or to a workbasket (shared queue). This is a fundamental concept in PEGA's work object processing and workflow management.