Computer Knowledge

Programming Languages and Compilers

1,170 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. it does not have structures

  2. it does not have pointers

  3. it has clean code

  4. it is object oriented

  5. it is a simple language

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

Absence of pointers makes a language clean.

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. procedural

  2. object oriented

  3. web development

  4. event driven

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

Java is fundamentally an object-oriented programming language. It supports core OOP principles like encapsulation, inheritance, and polymorphism through classes and objects. While Java can incorporate procedural and event-driven elements, its primary paradigm is object-oriented.

Multiple choice
  1. Java. lang

  2. Java. io

  3. Java. awt

  4. Java. applet

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

The java.lang package is automatically imported into every Java program without requiring an explicit import statement. It contains fundamental classes like Object, String, Math, and System that are essential for basic Java operations. Packages like java.io, java.awt, and java.applet require explicit imports.

Multiple choice
  1. Compiler

  2. Interpreter

  3. Assembler

  4. Comparator

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

An assembler converts assembly language (mnemonic instructions like MOV, ADD) to machine language (binary code the CPU executes). Compilers translate high-level languages to machine code, interpreters execute high-level code directly, and comparators compare data files. The assembler specifically handles assembly-to-machine translation.