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
A,C,D
Correct answer
Explanation
if is a conditional keyword, case is used in switch statements, and goto is a reserved word (though not used in Java). then is not part of Java syntax - Java uses curly braces, not then keywords like Pascal.
A
Correct answer
Explanation
In SQL databases, NULL specifically represents the absence of any value or an unknown/missing value. It is not the same as zero, empty string, or space - it literally means "no value present" for that field in that row.
B
Correct answer
Explanation
DECLARE CURSOR is a declarative SQL statement, not an executable statement. It defines the cursor's characteristics and the query it will execute, but doesn't actually perform any action when encountered. You must declare a cursor before you can OPEN, FETCH from, or CLOSE it. The declaration happens at compile/prepare time, not runtime.
A
Correct answer
Explanation
QTP/UFT supports working with multiple function libraries simultaneously during test development and execution. You can open multiple function library files, and the test can call functions from any of the loaded libraries, enabling modular reusable code.
B
Correct answer
Explanation
DECLARE CURSOR is a declarative statement, not an executable SQL statement. It defines the cursor's characteristics (the query and attributes) but does not actually process any data. The OPEN statement executes the cursor declaration by processing the query, and FETCH retrieves the actual rows.
B
Correct answer
Explanation
Unlike C and C++, sizeof is not a keyword in Java because Java does not need to determine the size of data types at compile-time due to its platform-independent virtual machine.
B
Correct answer
Explanation
In Java, null is a literal (specifically, the null literal) rather than a keyword, although it cannot be used as an identifier.
-
int[,] myArray;
-
int[][] myArray;
-
int[2] myArray;
-
System.Array[2] myArray;
A
Correct answer
Explanation
The comma syntax int[,] declares a rectangular two-dimensional array in C#. int[][] is a jagged array (array of arrays), int[2] is invalid syntax, and System.Array[2] is not valid array declaration syntax.
-
With OPTION STRICT ON keyword
-
With OPTION EXPICIT Keyword
-
With OPTION STRICT OFF keyword
-
All the above
A
Correct answer
Explanation
To enable Strict Type Checking in VB.NET, you need to use the "Option Strict On" keyword. This will enforce data type checking for all variables, parameters, and return types in your code.
Option Explicit, on the other hand, enforces explicit declaration of all variables in your code.
Option Strict Off disables strict type checking and allows automatic type conversions, making it easier to write code but potentially less safe.
Therefore, the correct answer is:
The Answer is: A. With OPTION STRICT ON keyword
-
Exit
-
Close Sub
-
Exit Sub
-
Kill
C
Correct answer
Explanation
Exit Sub immediately terminates execution of a VB.NET Sub procedure. Exit alone is incomplete, Close Sub is not valid syntax, and Kill is not a language keyword (it relates to file operations in some contexts).
-
Exit
-
Close Sub
-
Exit Sub
-
Kill
C
Correct answer
Explanation
In VB.NET, you terminate the execution of a subroutine (method) immediately and return control to the calling code using the Exit Sub statement.
-
RRW object
-
RAW object
-
RCW object
-
None of the Above
C
Correct answer
Explanation
In .NET, a Runtime Callable Wrapper (RCW) acts as a proxy that manages the lifetime and interaction between a .NET reference type variable and a COM object.
-
Option Explicit
-
Option Strict
-
Option All
-
All of the Above
B
Correct answer
Explanation
In VB.NET, turning on Option Strict restricts implicit data type conversions to only widening conversions, thereby disallowing incompatible or narrowing type conversions that could result in data loss.
-
Marks the end of a job
-
Marks the beginning of an instream procedure
-
Marks the beginning of a job & assigns a name to the job
-
Assigns an execution priority to a job
C
Correct answer
Explanation
The JOB statement is the first statement in a JCL stream; it marks the beginning of a job, assigns a unique name to the job, and provides accounting and execution parameters.
-
Positional, Keyword
-
Keyword, Control
-
Dynamic, Static
-
Named, Dynamic
A
Correct answer
Explanation
JCL statements, including the DD statement, utilize two primary types of parameters: positional parameters (which must appear in a specific order) and keyword parameters (which use key=value syntax).