Java Programming Concepts

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/42

flashcard set

Earn XP

Description and Tags

These flashcards cover key concepts in Java programming, including terminology, syntax, logic, and programming constructs like methods, loops, and operators.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

43 Terms

1
New cards

What is an object in Java?

An entity or data type created in Java; an instance of a class.

2
New cards

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.

3
New cards

What does 'void' indicate in a method declaration?

It designates that a method does not return any value to the caller.

4
New cards

What is a parameter in a method definition?

A variable used to receive a value from outside when the method is called.

5
New cards

What is an argument in Java?

The actual value provided to a method's parameter when the method is called.

6
New cards

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.

7
New cards

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.

8
New cards

What is an instance in the context of Java?

A specific object created from a class; each object is a different instance.

9
New cards

What does an instance variable represent?

A variable defined in a class for which every object (instance) of the class holds its own value.

10
New cards

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.

11
New cards

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

12
New cards

What does the access modifier 'public' signify?

It means a class, method, or variable can be accessed from outside the class.

13
New cards

What does the access modifier 'private' signify?

It means a class, method, or variable cannot be accessed from outside its class.

14
New cards

What is a variable in programming?

A container that stores a value in program memory which can be changed while the program runs.

15
New cards

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.

16
New cards

What is initialization in programming?

Assigning an initial value to a declared variable.

17
New cards

What is a data type in Java?

The format of data a variable can store, such as int, double, or boolean.

18
New cards

What is a primitive data type?

A basic data type provided by Java, like int, double, or boolean, which is not made from classes.

19
New cards

What does the int data type represent?

It stores whole numbers, positive or negative, without decimals.

20
New cards

What does the double data type represent?

It is used for decimal (floating point) numbers.

21
New cards

What does the boolean data type represent?

It has only two possible values: true or false.

22
New cards

What is a String in Java?

A sequence of characters (text), defined by the String class; not primitive.

23
New cards

What is the assignment operator in Java?

The equals sign (=) used to assign a value to a variable.

24
New cards

What is an integer constant?

A predefined constant value like Integer.MIN_VALUE.

25
New cards

What is an expression in programming?

A combination of variables, values, and operators that can be evaluated to produce another value.

26
New cards

What are arithmetic operators?

Symbols used to perform basic math operations: +, -, *, /, %.

27
New cards

What does casting mean in programming?

Forcing a value to change type, e.g., turning a double into an int.

28
New cards

What is a compiler?

A program that converts source code into code the computer can run, checking for syntax errors.

29
New cards

What is a syntax error?

A mistake in the code that breaks the rules of the language and prevents it from running.

30
New cards

What is the main method in Java?

The starting point of a Java program: public static void main(String[] args).

31
New cards

What does System.out.print() do?

It prints text to the screen without moving to a new line afterwards.

32
New cards

What does System.out.println() do?

It prints text to the screen and moves to a new line afterwards.

33
New cards

What is an identifier in programming?

The name chosen for a variable, class, or method.

34
New cards

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

35
New cards

What are the three parts of a for loop?

Initialization, Condition, and Update.

36
New cards

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.

37
New cards

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.

38
New cards

What does 'if' mean in programming?

A conditional statement that executes a block of code only if a specified condition is true.

39
New cards

What is a nested if statement?

An 'if' statement placed inside another 'if' statement allowing multiple levels of conditions.

40
New cards

What are compound boolean expressions?

Expressions that combine two or more boolean expressions using logical operators like AND (&&), OR (||), and NOT (!).

41
New cards

What is a while loop?

A loop that repeatedly executes a block of code as long as a given condition is true.

42
New cards

What is string manipulation?

Operations that modify, analyze, or process text strings.

43
New cards

What is nested looping?

Occurs when a loop is placed inside another loop.