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

  2. ZERO or Void Pointer

  3. Zero or void

  4. none

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

In C programming, NULL is a macro that expands to either 0 or a void pointer (void*) depending on context. It represents a null pointer constant. The correct answer captures both possibilities. Option C is similar but 'void' alone is not a pointer type.

Multiple choice softskills creativity
  1. True

  2. False

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

This statement is valid in Java. The 'new Integer(12)' creates an Integer object through autoboxing, and 'int _samId' unboxes it to a primitive int. The double underscore in '_samId' is a valid variable name in Java. This is syntactically correct and will compile.

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