Integer Wrapper Class and intValue Method
Which of the following code segments correctly demonstrates the creation of an Integer wrapper object and the subsequent retrieval of its primitive int value using the intValue method?
A
Integer num = new Integer(5); int a = num.intValue();
B
Integer num = new Integer(5); int a = num.getIntValue();
C
int num = new Integer(5); int a = num.intValue();
D
Integer num = 5; int a = num.getInt();
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | ponneban000 | 3 | 5 | 1m 41s | 179 |
| #2 | kaisuki | 1 | 2 | 0m 00s | 90 |
| #3 | aditirajaraman10272008 | 1 | 1 | 1m 01s | 39 |
| #4 | geethasailaja | 1 | 4 | 2m 18s | -68 |
| #5 | y.seong2027 | 1 | 3 | 4m 32s | -192 |
| #6 | singhris000 | 1 | 2 | 17m 01s | -931 |
APFIVE