Skip to content

Commit

Permalink
use of final keyword in java
Browse files Browse the repository at this point in the history
  • Loading branch information
Piyushvishnoi authored Jan 16, 2020
1 parent 0dafbcc commit b63c475
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions keywords in java/finalkeyworddemo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package tutorial;
class f
{
final Integer i; //i will become constant when assigned once
f()
{
i=10;
System.out.println(i);

}

}

public class finalkeyworddemo {

public static void main(String[] args) {

f a=new f();
}

}

0 comments on commit b63c475

Please sign in to comment.