• Card 25 / 76: Which of the statements are correct? (Choose all that apply.)
    A) 3.0 is a valid literal for an int.
    B) 3.0 is a valid literal for a float.
    C) 3 is a valid literal for an int.
    D) 3 is a valid literal for a float.
    E) 3f is a valid literal for an int.

    Answer:
    C) 3 is a valid literal for an int.
    D) 3 is a valid literal for a float.

  • Keyboard Shortcuts

    Previous Card ← Previous Card Button
    Next Card → Next Card Button
    Flip Card Space-Bar
<< First < Previous Next > Last >>

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now
Explanation:

C and D.

C is correct because an int is used to store an integer number.

D is correct because the compiler will automatically convert 3 to a floating-point number.

A, B, and E are incorrect.

A is incorrect because an int cannot store a decimal number.

B is incorrect because 3.0f would be a valid literal for a float, but 3.0 would not (the compiler treats 3.0 as a double).

E is incorrect because an int cannot have f appended to it.

Hide Choices Interactive Question Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Flash Cards plugin by Curtis Blackwell github.com/curtisblackwell/flash_cards
Google Play and the Google Play logo are trademarks of Google Inc.
Ask
Joanna Smithback
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>