How to define constant variable Java

How to define constant variable Java

Answer : Crate a class with public static final fields as shown below:

public static final double PI = 3.14159;

 

Leave a Reply

Your email address will not be published. Required fields are marked *