Java Final Variable || Burmese Tutorials

Опубликовано: 14 Июнь 2026
на канале: Infinity IT
65
7

Please Subscribe
https://www.youtube.com/c/Infinity_IT...

Final Variables
When a variable is declared with the final keyword, its value can’t be modified, essentially, a constant. This also means that you must initialize a final variable. If the final variable is a reference, this means that the variable cannot be re-bound to reference another object, but the internal state of the object pointed by that reference variable can be changed i.e. you can add or remove elements from the final array or final collection. It is good practice to represent final variables in all uppercase, using underscore to separate words.

    // a final variable
    // direct initialize
    final int number1 = 5;
      
    // a blank final variable
    final int number2;
      
    // another blank final variable
    final int  number3;
      
    // a final static variable PI
    // direct initialize
    static final double PI = 3.141592653589793;
      
    // a  blank final static  variable
    static final double number4;

If you make any variable as final, you cannot change the value of final variable(It will be constant).

If you don't want others (or yourself) to overwrite existing values, use the final keyword (this will declare the variable as "final" or "constant", which means unchangeable and read-only):

final int num = 1500;
num = 20; // will generate an error: cannot assign a value to a final variable

Please Subscribe
https://www.youtube.com/c/Infinity_IT...
Java Basic Tutorials || Burmese Language
   • Java Basic Tutorials || Burmese Language  

What is Java ? // Why Use Java ? // Burmese Tutorials
   • What is Java ? // Why Use Java ? // Burmes...  
Java Syntax && Java Output / Print //Burmese Tutorials
   • Java Syntax &&  Java Output / Print   @Inf...  
The Print Method // Java Print Number // Java Double Code //Burmese Tutorials
   • The Print Method // Java Print Number // J...  
Java Comments // Burmese Tutorials
   • Java Comments // Burmese Tutorial  @Infini...  
What is Java Variable & How Many Type Of Java Variable //Burmese Tutorials
   • What is Variable in Java (Burmese Tutorial...  
How to declare variables? || Java Integer Data Type || Burmese Tutorials
   • How to Declare variables? | Declaring and ...  
Java Floating Point Numbers - float and double - Java Tutorial || Burmese Tutorials
   • Java Floating Point Numbers - float and do...  
Character Data Type in Java Programming and Use Of char Variable || Burmese Tutorials
   • Character Data Type in Java Programming  a...  
The boolean Data Type in Java || Burmese Tutorials
   • The boolean Data Type in Java || Burmese T...  
Character Escape Sequence in Java || Burmese Tutorials
   • Character Escape Sequence in Java || Burme...  
Java Final Variable || Burmese Tutorials
   • Java Final Variable || Burmese Tutorials @...  
Java Display Variables with Plus Sign || Burmese Tutorials
   • Java Display Variables with Plus Sign ||Bu...  
How to Declare Many Variables in Java || Burmese Tutorials @Infinity_IT
   • How to Declare Many Variables in Java || B...  
Rules for Identifiers in Java || Burmese Tutorials @Infinity_IT ​
   • Rules for Identifiers in Java || Burmese T...  
What are Reserved Keywords in Java? || Burmese Tutorials @Infinity_IT
   • What are Reserved Keywords in Java? || Bur...  
The Data Types in Java | What is DataType? Explanation || Burmese Tutorials @Infinity_IT (Part - 1)
   • The Data Types in Java | What is DataType?...  
The Data Types in Java | What is DataType? Explanation || Burmese Tutorials @Infinity_IT (Part - 2)
   • The Data Types in Java | What is DataType?...  
Java Type Casting ||Burmese Tutorials @Infinity_IT
   • Java Type Casting ||Burmese Tutorials @Inf...  
Java - Basic Operators || Burmese Tutorials @Infinity_IT
   • Java - Basic Operators (Part-1)  || Operat...  
Increment and Decrement Operators in Java
   • Java - Basic Operators (Part-2) || Increme...  


Get Eclipse IDE 2022
   • Get Eclipse IDE 2022  
How To Create, Build And Run A Java Hello World Program With Intellij Idea On Windows 10
   • How To Create, Build And Run A Java Hello ...  
How To Uninstall Intellij IDEA Community Edition 2022 || Burmese Tutorial @Infinity_IT
   • How To Uninstall Intellij IDEA Community E...  


#Infinity_IT
#Infinity_IT #InfinityIT #InfinityITMyanmar #BurmeseInfinityIT #CSS #HTML #Javascript #JavaScript. #Java #React #Angular
#ObjectiveC #Scala #Python #C# #C++ #PHP #Perl #Java #Java #Java8 #JavaSE #BurmeseTutorials #Tuto #Assignment #package
#import #class #interface #abstract #public #private #protected #extends #implements #this
#super #byte #int #short #char #float #double#long #boolean #return #try#catch #finally #final #throw#throws
#do #while #for #if #else #switch #default #break #Java #Character #Method #Techno #2023
#continue #enum #instanceof #native #volatile #new #channel #infinityIT #Information #မြန်မာ #နည်းပညာ #operator