1/42
These flashcards cover key concepts in Java programming, including terminology, syntax, logic, and programming constructs like methods, loops, and operators.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is an object in Java?
An entity or data type created in Java; an instance of a class.
What does the keyword 'static' in Java signify?
It associates a method or variable with the class itself, not with specific objects, allowing use without creating an instance of the class.
What does 'void' indicate in a method declaration?
It designates that a method does not return any value to the caller.
What is a parameter in a method definition?
A variable used to receive a value from outside when the method is called.
What is an argument in Java?
The actual value provided to a method's parameter when the method is called.
What is the purpose of the 'new' keyword in Java?
It is used to create (instantiate) an object from a class, allocating memory for it.
What is a constructor in Java?
A special method in a class that runs when an object is created, used to set up initial values for fields.
What is an instance in the context of Java?
A specific object created from a class; each object is a different instance.
What does an instance variable represent?
A variable defined in a class for which every object (instance) of the class holds its own value.
What is a method in Java?
A block of code in a class that defines behavior, which can be executed (called) by objects or the class itself.
What is meant by return type in Java?
The kind of value a method will provide after running (e.g., int, String, or void if nothing is returned).
What does the access modifier 'public' signify?
It means a class, method, or variable can be accessed from outside the class.
What does the access modifier 'private' signify?
It means a class, method, or variable cannot be accessed from outside its class.
What is a variable in programming?
A container that stores a value in program memory which can be changed while the program runs.
What is declaration in the context of a variable?
Giving a name and data type to a variable but not yet assigning it a value.
What is initialization in programming?
Assigning an initial value to a declared variable.
What is a data type in Java?
The format of data a variable can store, such as int, double, or boolean.
What is a primitive data type?
A basic data type provided by Java, like int, double, or boolean, which is not made from classes.
What does the int data type represent?
It stores whole numbers, positive or negative, without decimals.
What does the double data type represent?
It is used for decimal (floating point) numbers.
What does the boolean data type represent?
It has only two possible values: true or false.
What is a String in Java?
A sequence of characters (text), defined by the String class; not primitive.
What is the assignment operator in Java?
The equals sign (=) used to assign a value to a variable.
What is an integer constant?
A predefined constant value like Integer.MIN_VALUE.
What is an expression in programming?
A combination of variables, values, and operators that can be evaluated to produce another value.
What are arithmetic operators?
Symbols used to perform basic math operations: +, -, *, /, %.
What does casting mean in programming?
Forcing a value to change type, e.g., turning a double into an int.
What is a compiler?
A program that converts source code into code the computer can run, checking for syntax errors.
What is a syntax error?
A mistake in the code that breaks the rules of the language and prevents it from running.
What is the main method in Java?
The starting point of a Java program: public static void main(String[] args).
What does System.out.print() do?
It prints text to the screen without moving to a new line afterwards.
What does System.out.println() do?
It prints text to the screen and moves to a new line afterwards.
What is an identifier in programming?
The name chosen for a variable, class, or method.
What is DeMorgan’s Law?
The negation of 'A and B' is 'not A or not B'; the negation of 'A or B' is 'not A and not B'.
What are the three parts of a for loop?
Initialization, Condition, and Update.
What does '>' mean in a loop condition?
It means the loop will continue as long as the variable is strictly greater than the comparison value.
What does '>=' signify in a loop condition?
It means the loop will continue as long as the variable is greater than or equal to the comparison value.
What does 'if' mean in programming?
A conditional statement that executes a block of code only if a specified condition is true.
What is a nested if statement?
An 'if' statement placed inside another 'if' statement allowing multiple levels of conditions.
What are compound boolean expressions?
Expressions that combine two or more boolean expressions using logical operators like AND (&&), OR (||), and NOT (!).
What is a while loop?
A loop that repeatedly executes a block of code as long as a given condition is true.
What is string manipulation?
Operations that modify, analyze, or process text strings.
What is nested looping?
Occurs when a loop is placed inside another loop.