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 declare a class as static?

0 Answers  


How many types of syncronization?

2 Answers  


How do you sort in java?

0 Answers  


Discuss different types of errors that generally occur while programming.

0 Answers   Amdocs,


What is a stream? what are the different types and classes of Streams?

2 Answers  


Can we initialize the final blank variable?

0 Answers  


What is the smallest package in Java API?

5 Answers   iGate,


What is unicode?

5 Answers  


Why do I need to declare the type of a variable in java?

0 Answers  


What is the purpose of the enableevents() method?

0 Answers  


Difference in the use of print, println, and printf.

5 Answers  


Difference between prefix and postfix forms of the ++operator?

3 Answers  


Categories