MCQs > IT & Programming > Java > What would happen on trying to compile and run the following code? public class Test { public static void main (String args[]) { int iRand; iRand = Math.random(); System.out.println(iRand); } }

Java MCQs

What would happen on trying to compile and run the following code?

 public class Test
 {
 public static void main (String args[])
 {
 int iRand;
 iRand = Math.random();
 System.out.println(iRand);
 }
 }

Answer

Correct Answer: A compilation error referring to a cast problem

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it