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 technology programming languages
  1. bless

  2. createobject

  3. create_object

  4. blessed

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

The bless function is Perl's object constructor mechanism - it associates a reference with a package/class, creating an object. Functions like createobject or create_object don't exist in Perl's OOP system. blessed is not a keyword (though exists() can check if something is blessed).

Multiple choice technology programming languages
  1. DESTROY

  2. AUTOHANDLE

  3. AUTOLOAD

  4. AUTOLOADER

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

AUTOLOAD is a special subroutine in Perl that gets called when an undefined subroutine is invoked. This enables dynamic method generation and graceful handling of missing methods. DESTROY (option A) is for object cleanup, and AUTOHANDLE/AUTOLOADER don't exist as special subroutines.

Multiple choice technology programming languages
  1. strict

  2. warning

  3. switch

  4. integer

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

In program module terminology, 'switch' is a control flow statement, not a modular program unit. 'strict' and 'warning' are compiler directives or keywords in some languages, and 'integer' is a data type. However, the question's terminology is unclear across programming languages.

Multiple choice technology programming languages
  1. REWRITE

  2. WRITE

  3. START

  4. READ

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

For sequentially accessed relative files, REWRITE does not use the INVALID KEY phrase because REWRITE in sequential mode operates on the last record read and doesn't involve key lookup. WRITE, START, and READ can all trigger INVALID KEY conditions in sequential relative file processing when key-related issues occur.

Multiple choice technology web technology
  1. True

  2. False

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

The RequestProcessor class (which handles processing) uses the Template Method pattern. It defines the skeleton of request processing in methods like processPreprocess(), processPopulate(), etc., with hooks for subclasses to override specific steps while maintaining the overall algorithm structure.

Multiple choice technology programming languages
  1. ASP.NET

  2. JAVA

  3. Visual C++

  4. COBOL

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

Hibernate is an Object-Relational Mapping (ORM) framework for Java applications. It maps Java objects to database tables and handles data persistence. Hibernate is not used in ASP.NET (.NET), Visual C++, or COBOL - those platforms have their own ORM solutions like Entity Framework, native C++ libraries, or COBOL-specific database interfaces.

Multiple choice technology programming languages
  1. True

  2. False

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

Java DOES support pass-by-reference in a limited sense - object references are passed by value. When you pass an object reference, you can modify the object's contents but cannot make the reference point to a different object. The claim that Java 'does not support pass by reference only pass by value' is therefore false - it's more nuanced.

Multiple choice technology programming languages
  1. True

  2. False

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

Java only supports variables defined within a class or method scope. Variables defined at the class level with static act similarly to global variables but are still scoped within their class, meaning Java does not have true global variables.

Multiple choice technology programming languages
  1. True

  2. False

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

In Java array syntax, int[] a, b[] declares 'a' as a 1D int array and 'b' as a 2D int array. However, int a[], b[] declares BOTH 'a' and 'b' as 1D int arrays. The brackets bind differently: in the first form, brackets apply only to the immediately preceding variable; in the second form, they apply to all variables in that declaration. This tests understanding of Java's mixed array declaration syntax.