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 3 out of 16 pages
Exam (elaborations)

CSE 205 Final Exam 2026: 100 Practice Questions with Answers and Explanations | PDF

Document preview thumbnail
Preview 3 out of 16 pages

CSE 205 Final Exam 2026: 100 Practice Questions with Answers and Explanations | PDF

Content preview

CSE 205 Final Exam 2026: 100 Practice Questions
with Answers and Explanations | PDF

SECTION 1 (1–50) (Java Fundamentals, Variables, Loops, Conditions, Operators)


1. What will be the value of an integer variable after assigning 15 and then
adding 10 to it?
Answer: 25
Explanation: 15 + 10 = 25 using basic arithmetic addition.


2. What data type should you use in Java for storing true or false values?
Answer: boolean
Explanation: boolean stores only two values: true or false.


3. What will happen if you divide two integers like 7 divided by 2 in Java?
Answer: 3
Explanation: Integer division removes the decimal part.


4. What is the result of 10 % 3 in Java programming?
Answer: 1
Explanation: Modulus returns the remainder after division.


5. What keyword is used in Java to declare a constant variable?
Answer: final
Explanation: final prevents value changes after assignment.

,6. What will be printed if you concatenate "Hello" and 5 using + operator?
Answer: Hello5
Explanation: String concatenation converts numbers to text.


7. What is the default value of a boolean variable declared globally in Java?
Answer: false
Explanation: Instance variables default to false if not initialized.


8. What happens when you use == between two primitive integers in Java?
Answer: Value comparison
Explanation: == compares actual numeric values for primitives.


9. What will be the output of 5 + 2 * 3 in Java following operator precedence?
Answer: 11
Explanation: Multiplication happens before addition.


10. What symbol is used to write a single-line comment in Java code?
Answer: //
Explanation: Double slash comments out a single line.


11. What happens if a variable is declared but not initialized inside a method?
Answer: Compilation error
Explanation: Local variables must be initialized before use.


12. What is the result of comparing 10 > 5 in a Java program?

, Answer: true
Explanation: 10 is greater than 5, so condition is true.


13. What type of loop executes at least once regardless of condition?
Answer: do-while loop
Explanation: Condition is checked after execution.


14. What will be printed when using System.out.println(3 + "3")?
Answer: 33
Explanation: Number is converted to string and concatenated.


15. What is the result of logical AND (&&) when one condition is false?
Answer: false
Explanation: AND requires both conditions to be true.


16. What keyword is used to create an object in Java?
Answer: new
Explanation: new allocates memory for objects.


17. What will happen if you try to access an array index that does not exist?
Answer: Runtime error (ArrayIndexOutOfBoundsException)
Explanation: Java prevents invalid memory access.


18. What is the size of an int data type in Java?
Answer: 32 bits
Explanation: Java defines int as a 4-byte value.

Document information

Uploaded on
May 4, 2026
Number of pages
16
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
£26.42

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.
Masterwritters
3.8
(30)
Sold
162
Followers
6
Items
2061
Last sold
2 days ago




Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight 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 smashed 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