Answer to Question #111893 in Java | JSP | JSF for Flores

Question #111893
What value(s) will be output by the following Java code statements?
System.out.println( (int)(Math.random()*8) + 1 ); _________________
System.out.println( Math.abs( -5 ) ); _________________
System.out.println( Math.abs( 6 ) ); _________________
1
Expert's answer
2020-04-24T11:33:24-0400

System.out.println( (int)(Math.random()*8) + 1 ); random integer number in [1,8]

System.out.println( Math.abs( -5 ) ); 5

System.out.println( Math.abs( 6 ) ); 6



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS