Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

CSE 2221 Midterm 2 Guide 2025. | Exam Revision Questions And Correct Answers | Graded A+ | 2025 Update |

Document preview thumbnail
Preview 2 out of 7 pages

CSE 2221 Midterm 2 Guide 2025. | Exam Revision Questions And Correct Answers | Graded A+ | 2025 Update |

Content preview

CSE 2221 Midterm 2 Guide 2025. | Exam Revision Questions And Correct
Answers | Graded A+ | 2025 Update |




variables - ANSWER- A named storage location in memory that holds a value. In Java,
variables must be declared with a type before use.


primitive types - ANSWER- Basic data types that store actual values, not references. Examples:
int (integer), double (floating point), boolean (true/false), char (single character).


reference types - ANSWER- Variables that store memory addresses rather than actual values.
Examples: String, arrays, objects.


arithmetic operators - ANSWER- Symbols used to perform mathematical operations.
Examples: + (addition), - (subtraction), * (multiplication), / (division), % (modulus, remainder).


comparison operators - ANSWER- Symbols used to compare values. Examples: == (equal), !=
(not equal), > (greater than), < (less than), >= (greater than or equal), <= (less than or equal).


logical operators - ANSWER- Operators used in boolean expressions. Examples: && (AND,
both conditions must be true), || (OR, at least one condition must be true), ! (NOT, negates a
boolean value).


assignment operators - ANSWER- Used to assign values to variables. Examples: = (assign),
+= (add and assign), -= (subtract and assign), *= (multiply and assign), /= (divide and assign).


modulo operator (%) - ANSWER- Returns the remainder of a division operation. Example: 10
% 3 results in 1.


if statement - ANSWER- A control flow statement that executes a block of code only if a
specified condition is true.

, if-else statement - ANSWER- An extension of the if statement that provides an alternate block
of code to execute if the condition is false.


nested if - ANSWER- An if statement inside another if statement, used to check multiple
conditions.


switch statement - ANSWER- A control structure that allows multiple possible execution paths
based on the value of a variable. Uses case labels and a default case.


for loop - ANSWER- A loop that executes a block of code a fixed number of times. Syntax:
for(initialization; condition; update) { // code }.


while loop - ANSWER- A loop that continues to execute as long as the specified condition is
true.


do-while loop - ANSWER- A loop that executes at least once before checking the condition,
ensuring the body runs at least one time.


break statement - ANSWER- Used to exit a loop or switch statement immediately.



continue statement - ANSWER- Skips the current iteration of a loop and moves to the next
iteration.


static method - ANSWER- A method associated with a class rather than an instance. Called
using ClassName.methodName(). Example: Math.sqrt(25).


instance method - ANSWER- A method that operates on an instance of a class. Called using
objectName.methodName().

Document information

Uploaded on
June 1, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LECTpharis
4.8
(8)
Sold
41
Followers
1
Items
6040
Last sold
2 months ago




Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions