This is the where I encountered a problem.
double num1 = Math.random();
double num2 = Math.random();
if (num1 < num2.num2) {
//do something
}
I want the the code to do something if the value of the square of num2 is more than the value of num1. However, NetBeans flagged this as an error saying that double cannot be dereferenced. What do I do?
num2.num2is not how you square a number in Java. This is:See The Java Tutorials: Assignment, Arithmetic, and Unary Operators.