Programming  >  QUESTIONS & ANSWERS  >  Section 4 B. All the methods in the Math class are static methods. Quiz With Answers. (All)

Section 4 B. All the methods in the Math class are static methods. Quiz With Answers.

Document Content and Description Below

1. All the methods in the Math class are static methods. Mark for Review (1) Points True (*) False ... 2. What is the approximate value of PI? Mark for Review (1) Points 0 2.718 The value varies. 3.141 (*) 3. A constant field, like Math.PI is used to represent a fixed value. Mark for Review (1) Points True (*) False 4. Every method of the Math class returns a numerical result. Mark for Review (1) Points True (*) False In. Refer to Section 4 Lesson 5. 5. What is the output? public static void main(String args[]) { String greeting = "Java World!"; String w = greeting.substring(7, 11); System.out.println(w); } Mark for Review (1) Points ld! orld! rld rld! (*) 6. A String is a sequence characters. Mark for Review (1) Points True (*) False 7. The replaceFirst() method replaces only the first occurrence of matching character pattern in a string. Mark for Review (1) Points True (*) False 8. String objects are immutable. Mark for Review (1) Points True (*) False 9. The String class must be imported using java.lang.String; Mark for Review (1) Points True False (*) 10. Which method returns the length of a String? Mark for Review (1) Points compareTo() findLength () length() (*) charAt() 11. What is the output? public static void main(String args[]) { String alphaNumeric = "Java World!" + 8; System.out.println(alphaNumeric); } Mark for Review (1) Points Compilation error. Java World!8 (*) Java World! 8 Java World! + 8 12. Using the Random class requires an import statement. Mark for Review (1) Points True (*) False 13. You need to generate random integer values between 0 and 80 (inclusive). Which statement should you use? Mark for Review (1) Points nextInt(80); nextInt(); nextInt(0-79); nextInt(81); (*) 14. You need to generate random integer values in the range 2 through 10. This code fragment will produce the desired result. Random r = new Random(); r.nextInt(9) + 2; Mark for Review (1) Points True (*) False 15. Which values are returned by the method nextBoolean(); Mark for Review (1) Points Returns the next value. Either a true or false. (*) An integer value. Nothing is returned. [Show More]

Last updated: 3 years ago

Preview 1 out of 6 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of Section 4 B. All the methods in the Math class are static methods. Quiz With Answers. document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$8.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

194
0

Document information


Connected school, study & course


About the document


Uploaded On

Oct 12, 2020

Number of pages

6

Written in

All

Seller


Profile illustration for QuizMaster
QuizMaster

Member since 6 years

1196 Documents Sold

Reviews Received
185
56
29
11
17
Additional information

This document has been written for:

Uploaded

Oct 12, 2020

Downloads

 0

Views

 194

Document Keyword Tags


$8.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·