Choosing how to earn college credit? CLEP vs AP guide
| preferred AP College board partner for AP classes
hard Solved by 19 students

Java Integer Overflow

Mark
< Prev
Next >

What is printed when the following code segment is executed?

int max = Integer.MAX_VALUE;
int result = max + 1;
System.out.println(result);
A

2147483648

B

2147483647

C

An ArithmeticException is thrown

D

-2147483648

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Total Time
Score
#1jeonsaw172322 0m 35s 165
#2thuyjerry11 - 100
#3kaisuki14 - 70
#4sailajavadlamani3314 - 70
#5sgarv251314 - 70
#629AmeliaC11 0m 30s 70
#7patrickmeijer00914 0m 50s 20
#8zgj0731041711 1m 47s -7
#9richa.tuli11 1m 50s -10
#10Potter1601 0m 05s -15
Items per page:
10
1 – 10 of 18
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Instagram: @_apfive_|Privacy Policy|