Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to define a constant variable in Java?



How to define a constant variable in Java?..

Answer / vidya bhushan dwivedi

The variable should be declared as static and final. So only one copy of the variable exists for all instances of the class and the value can't be changed also.

static final int MAX_LENGTH = 50; is an example for constant.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Core Java Interview Questions

Can we use a switch statement with strings?

0 Answers  


What is files manifesting?

0 Answers  


How to sort an array from smallest to largest java?

0 Answers  


When is the finalize() called? What is the purpose of finalization?

0 Answers  


Is 'null' a keyword?

8 Answers  


What is classes in java?

0 Answers  


Can final class have constructor?

0 Answers  


what are the differences between final,finally,finalize methods?

14 Answers   IBM,


What is difference between pointer and reference?

0 Answers  


Which list is sorted in java?

0 Answers  


Explain inheritance in java?

0 Answers  


What is difference between arraylist and list in java?

0 Answers  


Categories