Computer Knowledge

Programming Languages and Compilers

2,284 Questions

Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.

Object oriented languagesScripting languagesCompilers and parsersProgramming syntax

Programming Languages and Compilers Questions

Multiple choice
  1. 1st generation

  2. 2nd generation

  3. 3rd generation

  4. 4th generation

  5. 5th generation

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

Assembly language belongs to 2nd generation.

Multiple choice
  1. Ada

  2. Smalltalk

  3. Java

  4. Object Pascal

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

Ada (in its original versions) was not designed as an object-oriented programming language. It was primarily a structured, imperative language with strong typing. Smalltalk, Java, and Object Pascal all support object-oriented programming. Note: Ada 95 later added OOP features, but the original language did not have them.

Multiple choice
  1. Procedural languages

  2. Non-Procedural languages

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

Fourth Generation Languages (4GLs) are non-procedural - users specify WHAT to do, not HOW. Examples include SQL, query languages, and report generators. Earlier generations (3GL like C, Java) require procedural programming details.

Multiple choice
  1. True

  2. False

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

Low-level languages like assembly and machine code are designed for specific processor architectures. They directly reference hardware-specific registers, instructions, and memory addressing modes. Code written for x86 processors won't work on ARM processors without modification, demonstrating machine dependence. High-level languages provide abstraction and portability across platforms.

Multiple choice
  1. 3, 4, 1, 2

  2. 4, 3, 1, 2

  3. 3, 4, 2, 1

  4. None of the above

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

The correct JDBC sequence is: 1) Register Driver, 2) Get Connection, 3) Create Statement, 4) Execute Query. First, you register the JDBC driver, then establish a connection to the database, create a statement object, and finally execute the SQL query.

Multiple choice
  1. Vector

  2. Hash Table

  3. Stack

  4. Enumeration

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

Enumeration is an interface in Java that allows you to generate (iterate through) a series of elements one at a time from collections like Vector or Hashtable. Unlike other data structures, Enumeration specifically provides the hasMoreElements() and nextElement() methods for sequential access.