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
  1. Stack st=new Stack();

  2. Stack<string> st=new Stack<>();</string>

  3. Stack<char> st<>new Stack<char>();</char></char>

  4. Queue<integer> qq=new LinkedList<integer>();</integer></integer>

  5. All of the above

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

It is not possible to pass primitive data types as arguments to generic classes.

Multiple choice
  1. It generates symbol table and generates code afterwards.

  2. It allows labels, which can be defined after it is used.

  3. It does not allow defining a function after it has been called in the program.

  4. It allows a forward definition of a symbol or identifier.

  5. None of the above

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

All the functions has to be defined before they are used or called.

Multiple choice
  1. Compiler

  2. Program, since queue entries are overflowed

  3. Stack overflow

  4. Number of stacks assigned to this program crossed the maximum limit assigned to compiler

  5. Symbol table over flow

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

Every call to a recursive program creates a local stack of desired length. But if recursive function calls itself with in the function then another stack is crated for second call and this goes on as long as the recursive function call itself without completing it self. In the given prohram , the condition to close the recursion is not set and so the function is called endlessly. This situation has caused the error of insufficient memory, since no more space is available for new stack.

Multiple choice
  1. Float

  2. Interface

  3. String

  4. Unsigned

  5. None of these

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

An interface in the Java programming language is an abstract type that is used to specify an interface (in the generic sense of the term) that classes must implement.