What is the output from System.out.println((int)Math.random() * 4)?

a. 0
b. 1
c. 2
d. 3
e. 4

a Casting is performed before the * operator in (int)Math.random() * 4 . So, it returns 0.

Computer Science & Information Technology

You might also like to view...

When editing a hyperlink, it is enclosed in ________, which Access uses to activate the link when clicked

A) quotation marks (") B) asterisks (*) C) ampersands (&) D) pound signs (#)

Computer Science & Information Technology

A UNION clause in an SQL statement is used to ________

A) combine one or more queries B) identify the query criteria C) list the fields a query should display D) define how fields from related tables should be joined

Computer Science & Information Technology