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. If the function exists, it will be dropped and replaced with the new version created by the statement.

  2. If the function does not exist, it will create a new one.

  3. No action will be taken

  4. There is no such option available.

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

The REPLACE clause tells the database to drop an existing function of the same name and create the new definition instead of raising an error. This is precisely what the stored answer describes, so it is correct.

Multiple choice technology testing
  1. Cons: Path_Dir, Vari: path_dir

  2. Cons: PATH_DIR, Vari: path_dir

  3. Cons: Path_Dir, Vari: PATH_DIR

  4. Cons: PATH_dir, Vari: path_DIR

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

The standard naming convention across programming languages is that constants use ALL_CAPS_WITH_UNDERSCORES (PATH_DIR) while variables use lowercase_with_underscores (path_dir). This makes constants easily distinguishable from variables in code and improves readability.

Multiple choice technology programming languages
  1. Procedures do not return values

  2. Functions do not return values

  3. Procedure always return values

  4. None of these.

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

Historically, functions must return a value, while procedures do not. Note that procedures can return values via OUT parameters in many databases, but standard definition-level differentiation is that procedures do not return values directly via a RETURN statement.

Multiple choice technology databases
  1. Both are same

  2. case can check for non equality operator but decode checks for equality operator

  3. decode can be used for comparing value of one variable/condition. but case can check for multiple conditions

  4. case can not be used in where clause. but decode can be used.

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

In PL/SQL and SQL, CASE statements support complex logical conditions and non-equality operators (like < or >), whereas DECODE is limited to equality checks. CASE also handles multiple distinct conditions. Distractors incorrectly equate them.

Multiple choice technology testing
  1. Buil-in

  2. User-defined

  3. User-function

  4. Buil-in,User-defined

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

QuickTest supports two types of environment variables: built-in variables provided by the system, and user-defined variables created by testers. This combination allows flexibility in test configuration.

Multiple choice technology platforms and products
  1. True

  2. False

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

In DataStage, when a sequential file stage encounters a null value and the NullFieldValue property is not assigned, the row gets rejected. If no reject link is attached to handle rejected rows, the job aborts with a fatal error. This behavior ensures data quality by stopping execution rather than writing incomplete or inconsistent data.

Multiple choice technology programming languages
  1. True

  2. False

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

The main method CAN be overloaded - you can have multiple methods named 'main' with different parameter lists. However, only the standard main(String[] args) serves as the JVM entry point. Other overloaded main methods must be called explicitly like any other method. This is a common confusion point.

Multiple choice technology programming languages
  1. True

  2. False

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

Java allows the main method to be declared with any of the usual modifiers, including final. Declaring it final simply prevents the method from being overridden, which never happens for static methods anyway, so the statement is valid. The stored answer (True) is therefore correct.

Multiple choice technology programming languages
  1. int $x;
  2. int 123;

  3. int _123;

  4. int #dim;

  5. int %percent;

  6. int central_sales_region_Summer_2005_gross_sales;

Reveal answer Fill a bubble to check yourself
A,C,F Correct answer
Explanation

In Java, valid identifiers can start with a letter, an underscore (_), or a currency symbol (like $). Subsequent characters can also include digits. Identifiers cannot start with a digit, and symbols like # or % are not allowed.

Multiple choice technology programming languages
  1. If only line 1 is removed the code compiles.

  2. If only line 3 is removed the code compiles.

  3. If only line 5 is removed the code compiles.

  4. If lines 1 and 3 are removed the code compiles

  5. If lines 1, 3 and 5 are removed the code compiles.

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

Java doesn't allow enum declarations inside methods (line 5). Removing line 5 eliminates this syntax error, allowing compilation. Option C is correct. Removing all three enum declarations (lines 1, 3, 5) leaves only the class and method structure without any nested enums, which is valid Java - option E is correct. Options A, B, and D are incorrect because they still include the method-local enum declaration on line 5.

Multiple choice technology mainframe
  1. True

  2. False

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

REXX programs can indeed be compiled using a REXX compiler for improved performance and code protection. While REXX is traditionally an interpreted language, compilers exist that translate REXX source to executable form. The statement is accurate - REXX supports both interpreted and compiled execution models.