Q. Determine output of the following program.
public class Test{
public static void main(String args[]){
System.out.println( Math.floor( Math.random( ) ) ) ;
}
}

  • (A) 1.0
  • (B) 10.0
  • (C) 0.0
  • (D) 0.5
πŸ’¬ Discuss
βœ… Correct Answer: (C) 0.0
Explanation: random() is a static method defined in Math class.
Explanation by: Vikash Gupta
random() is a static method defined in Math class.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
247
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
83%
Success Rate