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

Multiple choice technology databases
  1. Dependency simplified

  2. Loaded once into memory , used subsequently

  3. Privileges to objects cannot be controlled

  4. Encapsulation of code logic

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Packages DO allow privilege control - you can grant EXECUTE privileges on the package, which controls access to all packaged objects. The other statements are true benefits: packages simplify dependencies, load once into memory, and encapsulate logic.

Multiple choice technology databases
  1. Procedure definition

  2. Function definition

  3. both A & B

  4. Option in both A & B

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Functions MUST include a RETURN statement because they are designed to compute and return a value. Procedures can execute without returning anything. The RETURN keyword is compulsory in function definitions to specify what value is computed and sent back to the caller.

Multiple choice technology web technology
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When a converter throws an exception or sets a conversion error, JSF marks the component as invalid. The isValid() method returns false for that component, and the component's value is not updated in the model. This prevents invalid data from propagating through the application.

Multiple choice technology platforms and products
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java is strictly pass-by-value. When passing objects, Java passes the reference by value - meaning you get a copy of the reference, not the original reference itself. This prevents methods from changing what the original variable points to. You can modify the object's state, but you cannot make the caller's variable reference a different object. Java has no true pass-by-reference semantics.

Multiple choice technology platforms and products
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The transient keyword in Java is used to indicate that a field should not be serialized when the class instance is converted into a byte stream. During deserialization, transient variables are initialized with their default values (e.g., null for objects, 0 for integers).

Multiple choice technology databases
  1. TRUE

  2. FALSE

  3. UNDEFINED

  4. NULL

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In SQL and PL/SQL, any comparison involving NULL values (including NULL = NULL) returns NULL (or UNKNOWN), not TRUE or FALSE. This is because NULL represents an unknown value, and you cannot determine whether two unknown values are equal. NULL requires special handling with IS NULL or IS NOT NULL operators.

Multiple choice technology databases
  1. %rowtype, %toomanyrows, %found

  2. %found, %notfound, %rowcount

  3. %rowtype, %rowcount, %notfound

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The standard implicit cursor attributes are %FOUND, %NOTFOUND, and %ROWCOUNT (along with %ISOPEN). In contrast, %rowtype is a data type declaration attribute rather than a cursor attribute, and %toomanyrows is a predefined exception.

Multiple choice technology databases
  1. 0

  2. NULL

  3. Results in a compilation error

  4. An exception will be raised

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To solve this question, the user needs to know what happens when a variable is declared in PL/SQL without an initial value.

The answer is:

B. NULL

If a variable is declared in PL/SQL without an initial value, its value will be NULL when it is first used in the executable section of the PL/SQL block. This means that the variable does not have a value assigned to it yet. If the variable is used in an expression or operation, it will result in a NULL value, which can cause unexpected behavior in your code.

Option A is incorrect because the variable will not have a value of 0 by default.

Option C is incorrect because declaring a variable without an initial value is legal and will not result in a compilation error.

Option D is incorrect because an exception will not be raised when a variable is declared without an initial value. It will simply have a value of NULL.

Multiple choice technology databases
  1. Header

  2. Declarative

  3. Exception

  4. Executable

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The Exception section of a PL/SQL block contains error trapping and handling logic. When an error occurs in the Executable section, control transfers to the Exception section where you can catch specific exceptions (like NO_DATA_FOUND) or use WHEN OTHERS for a catch-all handler. The Declarative section declares variables, and the Header section contains the block name and parameters.

Multiple choice technology databases
  1. DECODE

  2. TRUNCATE

  3. TO_CHAR

  4. NVL

  5. Trick question, all of these are Oracle DML functions.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

To solve this question, the user needs to know the meaning of Oracle DML (Data Manipulation Language) functions and should be able to identify which of the given options is not an Oracle DML function.

Oracle DML functions are used to manipulate data stored within the database. They are used to insert, update, select, and delete data from tables. These functions are used to modify the data values present in the database.

Now let's go through each option and explain why it is right or wrong:

A. DECODE: This is an Oracle DML function. It is used to compare expressions and return a value when the first matching condition is found.

B. TRUNCATE: This is not an Oracle DML function. It is a DDL (Data Definition Language) command used to remove all data from a table, but not its structure.

C. TO_CHAR: This is an Oracle DML function. It is used to convert a number or date to a string.

D. NVL: This is an Oracle DML function. It is used to replace NULL values with another value.

E. Trick question, all of these are Oracle DML functions: This statement is incorrect. Option B (TRUNCATE) is not an Oracle DML function.

Therefore, the answer is: B. TRUNCATE

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Function modules in SAP ABAP must be assigned to a function group. The function group serves as a container and provides shared memory context for all function modules within it. You cannot create a function module without specifying a function group.

Multiple choice technology programming languages
  1. BAPIRET2

  2. BAPIRETURN

  3. BAPIRET

  4. All the Above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

All three structures (BAPIRET2, BAPIRETURN, BAPIRET) are used as return parameter types in SAP BAPIs. BAPIRET2 is the current standard and recommended type. BAPIRETURN is the older/obsolete structure. BAPIRET is also a return structure type. The question uses 'All the Above' to acknowledge that all are valid return parameter structures, though BAPIRET2 is the modern choice.