Write the Java code to declare any constant (say gravitational constant) and to get its value?

Class ABC{static final float GRAVITATIONAL_CONSTANT = 9.8;public void getConstant(){system.out.println("Gravitational_Constant: " + GRAVITATIONAL_CONSTANT);}}

Showing Answers 1 - 1 of 1 Answers

manish

  • Jan 16th, 2007
 

class abc

{

 final const float PI=3.14f;

}

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions