Keyword in Java

Final keyword in Java programming language

Final keyword in Java programming language

In tis tutorial,We will discuss about Final keyword in Java programming language

final keyword

final is a Java keyword,  it is used to restrict the user, When the variable is defined as final, you can not changed the value of the final variable. So its constant The final key word can be use 3 situations

know more about final, click Usage of final in Java programming language

When the method is defined as final method – prevent method over riding

When the method is defined as final method – prevent class  inheritance

final variable

final variable define as

Syntax

<final><data_type><variable_name>=value;

Example

final int MY_AGE=23;              //this value can not be changed

final method

final method define as

Syntax

<final><return_type><method_name>

Example

final void demo(){}

final class

final class define as

Syntax

<final><class><class_name>{}

Example

final class parent{}

 

There are other Java language keywords that are similar to this keyword

abstract keyword in Java

boolean Keyword in Java

break keyword in Java

Byte keyword in Java 

case keyword in Java 

catch keyword in Java 

char keyword in Java 

class keyword in Java 

continue keyword in Java 

default keyword in Java 

do keyword in Java

double keyword in Java

else keyword in Java

enum keyword in Java

extends keyword in Java

final keyword in Java

finally keyword in Java

float keyword in Java

for keyword in Java

if keyword in Java

static keyword in Java

super keyword in Java

 

Suggested for you

Usage of this statement in the Java language

Keywords in Java language

Keywords in C language

Keywords in Python language

 

Usage of final in Java programming language

 

 

The instanceof operator in Java programming language
This keyword in Java programming language
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

3 weeks ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

1 month ago

Program to count vowels,consonants,words, characters and space in Java

Program to count vowels, consonants, words, characters and space in Java In this article, we…

1 month ago

How to print multiplication table using Array in C++ language

How to print multiplication table using Array in C++ language In this post, we will…

1 month ago

C Program to multiplication table using Array

C Program to multiplication table using Array In this tutorial , we will discuss about…

2 months ago

Java program to check odd or even using recursion

Java program to check odd or even using recursion In this tutorial, we discuss a…

2 months ago