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
-
Delegates are similar to function pointer in C++.
-
Delegates are type safe.
-
Delegates are value type.
-
None of the above
-
Both (2) and (3)
C
Correct answer
Explanation
This is false as delegates are reference type.
-
Stack st=new Stack();
-
Stack<string> st=new Stack<>();</string>
-
Stack<char> st<>new Stack<char>();</char></char>
-
Queue<integer> qq=new LinkedList<integer>();</integer></integer>
-
All of the above
C
Correct answer
Explanation
It is not possible to pass primitive data types as arguments to generic classes.
-
int
-
float
-
char
-
string
-
none of the above
B
Correct answer
Explanation
We cannot use float type on switch statement.
-
Native
-
Static
-
Syncronized
-
Final
-
None of the above
C
Correct answer
Explanation
Syncronized modifier is often used in multithreaded programs.
-
5sum
-
Not/Ok
-
AvgSpeed
-
current-temp
-
Del hi
C
Correct answer
Explanation
This is the only valid variable declaration in Java as it begins with letter only.
-
Member
-
Manipulator
-
Allocator
-
Operator
-
Constructor
B
Correct answer
Explanation
Manipulators are objects that can modify a stream using the << or >> operators.
-
Integer and float
-
String and float
-
Character and string
-
Integer or character
-
Float and double
D
Correct answer
Explanation
Only integer or character variables are used with case keyword.
-
Concrete manifestation of a token in the text
-
Key words
-
White spaces
-
Value of an integer token defines value of identifier M
-
Delimiter
D
Correct answer
Explanation
Attributes define the token by its value.
-
It generates symbol table and generates code afterwards.
-
It allows labels, which can be defined after it is used.
-
It does not allow defining a function after it has been called in the program.
-
It allows a forward definition of a symbol or identifier.
-
None of the above
C
Correct answer
Explanation
All the functions has to be defined before they are used or called.
-
Compiler
-
Program, since queue entries are overflowed
-
Stack overflow
-
Number of stacks assigned to this program crossed the maximum limit assigned to compiler
-
Symbol table over flow
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.
-
Bottom up
-
Operator precedence
-
Top down
-
Top up
-
Shift reduce
C
Correct answer
Explanation
Back tracking is required to find nearest root in top down parsing.
-
Postfix notations
-
Syntax tree
-
Quadrupples
-
Intermediate code is not generated at all
-
Tripples
D
Correct answer
Explanation
Single pass compiler does not generate intermediate code , since equivalent code is generated as and when the statement is scanned.
-
scanf( ) and printf( )
-
getchar( ) and printf( )
-
scanf( ) and putchar( )
-
getchar( ) and putchar( )
-
get() and put()
D
Correct answer
Explanation
Both the system defined functions are used for single character input and output respectively.
-
Float
-
Interface
-
String
-
Unsigned
-
None of these
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.
-
Arrow operator
-
Scope resolution operator
-
Assignment operator
-
Equality operator
-
None of these
B
Correct answer
Explanation
Scope resolution operator overloading is not possible.