+ 3

Explain the followings in java

Please provide the solution with proper explanation!! 1. int a = 25; System.out.println(a/4.0); 2. \\ Possible outputs double d = Math.random(5)*10; System.out.println(d); (Edit: 3. int a=079; System.out.println(a);

8th Nov 2018, 3:44 AM
Ananya Pandey
Ananya Pandey - avatar
1 Answer
0
1. The variable a equals 25 System out println shows via console the result of the division of a (25) divided by 4 2. This case should cause an error. Java doesn't have a Math.random() method. But let's say, that Math.random(5) gives a random number between 0 and 5 We get that number, and multiply it by 10. then we save it on the variable 'd'
8th Nov 2018, 3:48 AM
voidneo