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

could you run the java program without main method?

6 Answers  


Can we define static methods inside interface?

0 Answers  


Can we inherit the constructor in a Class?please give one example.

9 Answers   iGate,


Describe inheritance as applied to java?

4 Answers  


What is toarray method in java?

0 Answers  


What is communist flag?

0 Answers  


What is an off by one error in java?

0 Answers  


What problems will occur when you don?t use layout managers?

1 Answers  


What is a function in java?

0 Answers  


What is the same as procedures?

0 Answers  


How many types of modifiers are there?

1 Answers   Infosys,


how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion

2 Answers   SAP Labs,


Categories