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.
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.
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);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us