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 softskills creativity
  1. Heap

  2. Kernal

  3. Stack

  4. Static Data Blocks

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

While the method code itself is stored in the Code Segment/Method Area, the execution of methods (including local variables and call frames) occurs on the Stack. However, the question is slightly ambiguous as 'stored' usually refers to the Method Area.

Multiple choice technology web technology
  1. myFunction()

  2. call myFunction()

  3. call function myFunction

  4. function myFunction

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

To call a function named "myFunction", you need to use option A, which is "myFunction()". This syntax will execute the code inside the function and return any value that is specified in the function.

Option B, "call myFunction()", is incorrect because it is not valid syntax for calling a function in most programming languages, including JavaScript.

Option C, "call function myFunction", is also incorrect because it is not valid syntax for calling a function in most programming languages, including JavaScript.

Option D, "function myFunction", is incorrect because it only declares the function, but does not actually call it. To execute the code inside the function, you need to use the function name followed by parentheses, like in option A.

Therefore, the answer is: A. myFunction()

Multiple choice technology programming languages
  1. True

  2. False

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

In programming languages with exception handling (like Java, C#, Python), you cannot catch the same exception type twice in the same try-catch block. The compiler will flag this as an error because the first catch handler would always handle that exception type, making the second one unreachable code. This applies whether the exceptions are exact type matches or one is a subclass of the other.

Multiple choice technology programming languages
  1. True

  2. False

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

Most database systems support function overloading - you can have multiple stored functions with the same name if they have different parameter lists (different number, types, or order of parameters). This is similar to method overloading in object-oriented programming languages like Java or C#. The database distinguishes which function to call based on the arguments provided.

Multiple choice technology programming languages
  1. True

  2. False

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

Function overloading requires differences in the parameter list (number, types, or order), not just the return type. In languages like Java, C++, and C#, the return type is not part of the function signature used for overload resolution. If two functions differ only by return type, the compiler cannot determine which one to call in contexts like standalone function calls or assignments where the return type isn't immediately clear.

Multiple choice technology mainframe
  1. Marks the end of a job

  2. Marks the beginning of an instream procedure

  3. Marks the beginning of a job & assigns a name to the job

  4. Assigns an execution priority to a job

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

The JOB statement in JCL marks the beginning of a job and assigns a name to it. It is the first statement in any JCL job stream and provides job-level information like the job name, accounting info, and priority.

Multiple choice technology web technology
  1. public static void main(String args[])

  2. public static void main(String appp[])

  3. public void static main(String args[])

  4. public Static void main(String args*)

Reveal answer Fill a bubble to check yourself
A,B,C,D Correct answer
Multiple choice technology programming languages
  1. Module

  2. Private

  3. Satellite

  4. Shared

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

Satellite assemblies contain culture-specific resources such as translated strings, images, or other localized content. They are compiled separately from the main assembly and are automatically loaded by the CLR based on the current thread's UI culture setting, allowing applications to support multiple languages without duplicating code.

Multiple choice technology databases
  1. True

  2. False

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

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 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.