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]
Comments
Leave a comment