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 is a newline character in java?

0 Answers  


Can we have multiple catch block for a try block?

0 Answers  


what is java

10 Answers  


What is an object?s lock? Give name of object?s that have locks?

2 Answers  


Can a abstract class be declared final?

0 Answers  


What is the difference between Stream Reader and Stream Writer?

4 Answers  


how to handle exceptions in ejb?

1 Answers   HCL,


What is meant by JVM? Is JVM platform independent or not?

0 Answers   Wipro,


What are the two ways in which thread can be created?

0 Answers  


Difference between this() and super() ?

0 Answers  


Can you sort a string in java?

0 Answers  


Define canvas?

0 Answers  


Categories