Java question | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Java question

Can i do this in java? double pi = Math.PI();

17th Apr 2021, 4:29 PM
3 Respuestas
+ 8
Eric No you can do Math.PI not Math.PI() PI is not a method it's a value. In Math class it is declared as public static final double PI = 3.14159...;
17th Apr 2021, 4:37 PM
AÕĘJ - avatar
+ 3
Maybe it would be like this:
17th Apr 2021, 4:36 PM
The future is now thanks to science
The future is now thanks to science - avatar
PI is a variable, not a method.
21st Aug 2021, 4:06 AM
Evseev Anton
Evseev Anton - avatar