How To Implement Constants In Java
Rate this article
0 out of 5
In this tutorial we will show you how to implement constants in java. After viewing the video tutorial, download the source code and try to modify the code so as to get a feel of what is learned in this video tutorial.


Source Code
 ConstDemo
class ConstDemo
{
     final float a=10f;
     final int b=5;
     void add()
     {
           a=a+10f;
           b=b+10;
           System.out.println("a= "+a);
           System.out.println("b= "+b);
     }
}

class ConstTest
{
       public static void main(String args[])
       {
             ConstDemo obj=new ConstDemo();
             obj.add();
        }
}
       
  


Source Code

About The Author
TekTips Videos

Number Of articles Posted      : 27
Number Of Messages Posted  : 0
Joined Date : 2013/2/04
   
Author
Messages
Posted:
Post Your Comments  
Name (Max 50 Chars)
Comments
 
 

 
TekTipsDownload
GateExam
Academic Projects
TekTipsExperts
Android