Java question | SoloLearn: Learn to code for FREE!

+1

Java question

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

4/17/2021 4:29:28 PM

Eric

2 Answers

New Answer

+7

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...;

+3

Maybe it would be like this: https://code.sololearn.com/cA0A0a7A04A1