The answer is C and D.
A. float flt = 100.00F; // correct
B. float flt = (float) 1_11.00; // correct
C. Float flt = 100.00; // assigning a double to Float object without explicit cast
D. double y1 = 203.22; float flt = y1; // assigning a double to a float without explicit cast
E. int y2 = 100; float flt = (float) y2 ; // correct
Answer is CD.
To test, uncomment one option at a time in the IDE and check the error.
public static void main(String[] args) {
//float flt = 100.00F; // A - Ok
//float flt = (float) 1_11.00; // B - Ok
//Float flt = 100.00; // C - Error - need cast to Float.
//double y1 = 203.22; float flt = y1; // D - Error - need cast to float.
//int y2 = 100; float flt = (float) y2 ; // F - Ok
}
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
fvelazqueznava
6 months, 2 weeks agoDarGrin
6 months, 2 weeks agoanastacia
6 months, 3 weeks agoIbrahimAlnutayfi
10 months agoVicky_65
1 year agoHirushi
1 year, 2 months agoakbiyik
1 year, 4 months agoakbiyik
1 year, 4 months agocarloswork
1 year, 5 months agoiSnover
1 year, 6 months agoiSnover
1 year, 6 months agoshivkumarx
1 year, 7 months agoshivkumarx
1 year, 7 months ago