Click here to Skip to main content
15,903,033 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So this question doesn't have to do with a specific application, it's just something that i've been wondering overall. Let's say you're creating a class called Star.Inside the class in several places and elsewhere in the application, the value of the speed of light, which is a constant (186000 miles/second), is needed. What would be the best way to implement this? Preferably I need it implemented in the Star class itself.

What I have tried:

lot's of different options in the past, just trying to find out what the best way. to do it is.
Posted
Updated 13-May-20 15:57pm
Comments
F-ES Sitecore 14-May-20 6:22am    
c# or java? Different languages implement these things in different ways.

1 solution

Declare it as a Global or Application variable; how to do this will depend on the language and frameworks that are in use
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900