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 programming languages
  1. call by value

  2. call by reference

  3. call by address

  4. All the Above

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

When you pass pointers to a function, the function receives the address of the original variable. The function can access and modify the original data through that address. Call by value copies the actual parameter, call by address means passing pointers explicitly.

Multiple choice technology programming languages
  1. Inline functions

  2. virtual functions

  3. Both A and B

  4. None of the Above

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

An inline function suggests to the compiler that the function's code should be inserted directly at the point of call to eliminate function call overhead. Virtual functions support dynamic dispatch instead of inline substitution, and the other options are incorrect.

Multiple choice technology programming languages
  1. Prefix the string 'private' to the variable name.

  2. initialize it with '_init_private'

  3. initialize it with double underscore '__'

  4. append the keyword 'pvt' before the variable.

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

Python uses name mangling with double underscore prefix (__) to indicate private variables. This makes the variable harder to access from outside the class, though it's still technically possible.

Multiple choice technology programming languages
  1. True

  2. False

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

Final methods in Java CANNOT be overridden by subclasses. The final keyword specifically prevents modification - it's the entire purpose. When a method is declared final, subclasses must use it as-is and cannot provide their own implementation. Therefore the answer 'False' to 'Can final method be overridden?' is correct.