Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

difference between final and constant in java

class Data {
   final int integerConstant = 20;
}
public class ConstantExample {
   public static void main(String args[]) {
      Data obj1 = new Data();
      System.out.println("value of integerConstant: "+obj1.integerConstant);
      Data obj2 = new Data();
      System.out.println("value of integerConstant: "+obj2.integerConstant);
   }
}
Comment

what is difference between constant and final in java

Constant is the concept, the property of the variable.

final is the java keyword to declare a constant variable.
Comment

PREVIOUS NEXT
Code Example
Java :: regex pattern to mathc IP address 
Java :: tinyint in java 
Java :: An exception occurred processing JSP page /Home.jsp 
Java :: pattern exercises for java 
Java :: mincraft command in plugin 
Java :: Performance data in appium 
Java :: konva crop outside width and height of image 
Java :: java t point c# 
Java :: how-to-use-volley-string-request-in-android 
Java :: validate text field netbeans emails 
Java :: Zooming an Image using OpenCV in Java 
Java :: print jtable in java 
Java :: fly dfguyghj: Javascript 
Java :: while(++i<5)f*=i;System.out.println(f); 
Java :: priority queue java remove 
Java :: quick sort in java progrmmieren 
Java :: scanner in = new scanner(system.in) meaning in java 
Java :: convert jython object to java object 
Java :: UIManager.setLookAndFeel Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: Cannot invoke because "style" is null 
Java :: lauch app from brodcast reciever 
Java :: how to see page is open in selenium 
Java :: JSP Redirigir a otra página 
Java :: consumer 
Java :: Java create an object of the static class Mammal 
Java :: super class and concrete class in java 
Java :: java replace second char of a string 
Java :: android detect screen on by intent broadcast receiver 
Java :: format code netbean 
Java :: java opengl get fps 
Java :: ASCII PrintWriter java.io examples 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =