Computer Knowledge

Programming Fundamentals

2,381 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. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. True

  2. False

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

Garbage collection reclaims memory from unused objects, but it doesn't prevent out-of-memory errors. If you create objects faster than GC can collect them, or if you have memory leaks (unintentional object references), the program can still exhaust available heap space. GC is a management tool, not a memory guarantee.

Multiple choice technology programming languages
  1. With OPTION STRICT ON keyword

  2. With OPTION EXPICIT Keyword

  3. With OPTION STRICT OFF keyword

  4. All the above

Reveal answer Fill a bubble to check yourself
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

Multiple choice technology testing
  1. the use of a variable before it has been defined

  2. unreachable code

  3. memory leaks

  4. array bound violations

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

Memory leaks are a runtime phenomenon that depends on dynamic allocation and deallocation patterns during program execution. Static analysis can detect potential leaks through code inspection but cannot definitively identify actual memory leaks without runtime information. The other options are all detectable through compile-time analysis.

Multiple choice technology web technology
  1. Serialization

  2. Garbage Collection

  3. Assemblies

  4. Overriding

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

The .NET Framework provides automatic memory management through Garbage Collection. The Garbage Collector automatically allocates and manages memory for applications, reclaiming memory from objects that are no longer in use. Serialization converts objects to streams, Assemblies are deployment units, and Overriding is an object-oriented programming concept.

Multiple choice technology programming languages
  1. a

  2. b

  3. c

  4. Don't know

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

Float.isNan(x) is the correct way to check for NaN (option a has typo). Using x == Float.NaN always returns false because NaN is defined as not equal to any value including itself. Option c's correctness depends on Myobject's equals implementation, but Float's equals method correctly handles NaN.