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

What do you mean by append?

0 Answers  


Do I need to import java.lang package any time? Why?

1 Answers  


Can we access the non-final local variable, inside the local inner class?

0 Answers  


What is the set interface in java programming?

0 Answers  


How do you detect memory leaks?

0 Answers  


Why we do exception handling in java and how many types of exceptions are there?

0 Answers  


What are the properties of thread?

0 Answers  


Is constructor inherited?

0 Answers  


What are the files generated after using IDL to java compiler?

0 Answers  


what is the difference between @include page and @include file

2 Answers  


How to create a thread in java?

0 Answers  


Can array grow dynamically in java?

0 Answers  


Categories