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
-
a program
-
an object deck
-
an execution
-
a single-line
B
Correct answer
Explanation
In a standard two-pass assembler, the first pass is dedicated to scanning the source code to identify symbols and build a symbol table. The second pass uses the addresses determined in the first pass to translate the assembly code into machine code. The resulting output is known as an object deck or object module, which is ready for the loader.
-
relational operator
-
by reference assignment operator
-
assignment operator
-
concatenation operator
-
NULL
B
Correct answer
Explanation
PHP enables you to create variables as aliases for other variables are achieved by that operator.
-
cast operator
-
assignment operator
-
concatenation operator
-
relational operator
-
array
A
Correct answer
Explanation
PHP provides a C like way to force a type conversion of a value by using the cast operator.
-
It is used to store a direct pointer to the new value, but call release on the old value and retain on the new one.
-
It uses a direct pointer to the new value.
-
It increases the retain count of an object by 1.
-
It decreases the retain count of an object by 1.
-
It makes a copy of an object and returns it with retain count of 1.
B
Correct answer
Explanation
Assign is used to set a property's pointer to the address of the object without retaining it or otherwise curating it.
-
Independent
-
Separate
-
Time bound
-
None of these
-
These exceptions are raised implicitly.
-
These exceptions can be handled explicitly also.
-
These are pre-defined exceptions and given a name in Oracle.
-
EXCEPTION_INIT has associate a predefined Oracle error number to a programmer_defined exception name.
-
The pragma EXCEPTION_INIT is declared in the declarative part of a PL/SQL block.
C
Correct answer
Explanation
These are not the exceptions that occur frequently. So, these are not predefined and cannot be given a name in Oracle.
-
An user-defined exception must be declared and then raised explicitly.
-
An user defined exception can be created using a RAISE statement.
-
The procedure DBMS_STANDARD. RAISE_APPLICATION_ERROR can also throw an user defined exception.
-
RAISE statements can raise predefined exceptions and also user defined exceptions.
-
User-defined exceptions are declared in the exception section with their types as exceptions.
E
Correct answer
Explanation
This is false as user defined exceptions are declared in the declaration section with their types as exception.
-
These exceptions are internally defined exceptions with a name.
-
These exceptions are raised by the system.
-
The storage error is a predefined exception.
-
Out of memory is a predefined exception.
-
ZERO_DIVIDE is an example of predefined exception.
D
Correct answer
Explanation
This is an internally defined exception and not a predefined exception.
-
Execution support
-
Value type
-
SSL box
-
Unboxed
-
Boxed
E
Correct answer
Explanation
When a variable of a value type is converted to object, it is said to be boxed.
A
Correct answer
Explanation
In Java, a variable declared within the initialization block of a for loop has a scope limited to that loop; it cannot be accessed outside.
-
Nothing is wrong
-
Break is not used in case 2
-
Default is not there
-
Num4 = 400 is not reachable
A
Correct answer
Explanation
Though num 4 is not reachable but as for as code is concerened there is nothing wrong. May be the programmer wants it like that.
-
true
-
false
-
Depends on the exception.
-
None
C
Correct answer
Explanation
There may not be a termination for throwing an exception, it depends on the exception itself whether it should be terminated or not.
-
float[ ] marks
-
number = new int[5]
-
int product [ ] [ ]
-
float num{ }
D
Correct answer
Explanation
In Java, array declaration syntax requires square brackets []. Option D uses curly braces {}, which is incorrect for array declaration.
-
By avoiding goto statements
-
By using meaningful and indicative names of variables and functions
-
By using modular programming
-
All of the above
D
Correct answer
Explanation
Readability is improved by using clear naming conventions, avoiding complex control flow like goto, and utilizing modular programming to break code into manageable pieces.