Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
easy Solved by 24 students

Type Casting in Division

Mark
< Prev
Next >

What is printed when the following code segment is executed?

public class Main {
    public static void main(String[] args) {
        int a = 7;
        int b = 2;
        double result = a / (double) b;
        System.out.println(result);
    }
}
A

3

B

3.0

C

3.5

D

Runtime Error

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
#1ravi.palepu11 0m 00s 100
#2anusha.ghadge11 0m 00s 100
#3zhenmunse11 0m 01s 99
#4songqiuhui201211 0m 04s 96
#5kazvin.tjakradinata11 0m 06s 94
#6Potter1611 0m 09s 91
#7patrickmeijer00911 0m 12s 88
#8parth.taur22711 0m 13s 87
#9Wilbert.Ankomah2711 0m 15s 85
#10701704611 0m 18s 82
Items per page:
10
1 – 10 of 19

AI Tutor

How can I help?

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