Introduction Flashcards
Intro to Programming, Variables, Data Types & Operators.
What is a command in programming?
A directive telling the computer to perform a specific action (e.g., print()).
What is a statement in programming?
A complete unit of execution that performs an action (e.g., if statement, for loop).
What is an expression in programming?
A combination of variables, operators, and values that produce a result (e.g., x + 5).
How do commands, statements, and expressions relate?
Commands execute tasks, statements perform actions (often containing expressions), and expressions compute values.
What is coding?
Writing code to implement specific logic in a programming language.
What is programming?
The broader process of designing, writing, testing, and maintaining software, which includes coding.
What’s the key difference between coding and programming?
Coding is writing syntax; programming involves solving problems and designing systems.
Which skills are needed for coding vs programming?
- Coding: Syntax knowledge, debugging, basic problem-solving.
- Programming: Analytical thinking, algorithms, design, testing, and collaboration.
What are the main components of a programming language?
Syntax, data types, variables, operators, control structures, functions, and error handling.
What are control structures in a programming language?
Constructs like loops and conditionals that manage program flow.
What role do functions play in a programming language?
Reusable blocks of code that perform specific tasks, often with inputs and outputs.
What is the purpose of data types in programming?
Define the types of data a program can manipulate, such as integers, strings, or objects.
What is the relationship between JDK, JRE, and JVM?
JDK: A toolkit for developing Java applications, including the JRE.
JRE: Used to run Java applications; includes the JVM.
JVM: The engine that runs Java bytecode and manages execution.
What are the types of memory in the JVM?
Heap: Stores objects.
Stack: Stores method calls and local variables.
Method Area (MetaSpace): Stores class metadata.
Program Counter Register: Tracks thread execution.
Native Method Stack: For managing native code.
What is the role of the JIT compiler in Java?
Converts bytecode into machine code at runtime to improve performance.