SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice question 24 of 25
Which type of language requires variables to be declared ahead of time and prohibits their types from changing while the program runs?
Full set: 137 questionsThe term "static" refers to static typing, a characteristic of a programming language where type checking is performed at compile-time rather than at runtime. In statically-typed languages like C++, Java, and C#, a variable's type must be explicitly declared before the variable is used. Once declared, the type is fixed and cannot be changed during the program's execution. This approach allows for early error detection and can lead to performance optimizations.
Scripted (interpreted): Many scripting languages (e.g., Python, JavaScript) are dynamically typed, which is the opposite of the described behavior. Procedural: This describes a programming paradigm, not a typing system. A language can be procedural and either statically or dynamically typed. Compiled: While most statically-typed languages are compiled, "static" is the more precise term for the type system itself, not the execution model.
1. Scott, M. L. (2015). Programming Language Pragmatics (4th ed.). Morgan Kaufmann. (Chapter 6, "Type Systems," Section 6.2, defines and contrasts static and dynamic typing, explicitly stating that static typing involves compile-time checks and fixed variable types).
2. Pierce, B. C. (2002). Types and Programming Languages. MIT Press. (Chapter 1, "Introduction," provides a formal definition of static type systems as a method for proving the absence of certain program behaviors at compile time).
3. Microsoft. (n.d.). C# documentation - Types. Retrieved from https://docs.microsoft.com/en-us/dotnet/csharp/tour-of-csharp/types-and-variables (The documentation for C#, a statically-typed language, states, "C# is a strongly-typed language. Every variable and constant has a type...").
Keep practicing
Take the free SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice questions
- Question 1Which characteristic distinguishes a markup language from other languages?
- Question 2A program calculates the average miles per gallon given miles traveled and gas consumed H…
- Question 5Which characteristic specifically describes an object-oriented language?
- Question 6Which is one characteristic of an object-oriented language that is not a characteristic o…
- Question 7Which operation should be used to check if the difference of two values is greater than 1?
- Question 9A program allows the user to play a game. At the end of each game, the program asks the u…
