Skip to content
Home » Java Programing Language » Super, This, Static & Final Keywords In Java

Super, This, Static & Final Keywords In Java

super Keyword

  1. super keyword is use to access properties of super class.
  2. By Using super keyword you can access the methods, variables and constructor of super class.
  3. Super is not an object of super class.
  4. Every Constructor of sub class by default calls a super class default/no-parameter constructor.
  5. You can also call a super class constructor by using super keyword, but it must be called from constructor only and it has to be a first line in a constructor.

 

this keyword

  1. this keyword is use to access the properties of same class.
  2. By using this keyword you can access the methods, variables and constructor of same class.
  3. this is also consider as a current class object.
  4. By using this you can call constructor of same class, but constructor call must be inside another constructor only.
  5. Constructor calling must be a first line in a constructor.

 

 

static Keyword

  1. Static keyword is use to create class level variable and methods.
  2. Static can be use for class also, but static classes must be an inner class.
  3. Static variables and methods can be access outside class without class object and just by class name.
  4. Can Create a static block, which is mostly use to initialize the static variables.
  5. Static block execute at the time of class loading and it executes only once.
  6. Static block or static method cannot access non-static variable or method.
  7. Cannot use super and this keyword inside static block, class or inside static method.

 

final Keyword

  1. Final keyword is use to create a constants (value will fixed throughout the program).
  2. Can be a class, variable, method.
  3. Final variables can be instance or local variable.
  4. The value of final variable never change.
  5. Rules to assign value to a final variable.
    1. Must provide a value to a final variable.
    2. Final variable can be initialize at declaration time or inside every constructor of class or inside initializer block.
  6. Final class cannot be use as a super class. In-build final classes are String, System.
  7. Final methods cannot be override.

 

 

Join Telegram : Click Here

 

All Full Stack Java Study Material

 

Java the programing language Keywords in Java Static Final

 

Job’s For Fresher

 

Share This Information To Your Friends and Your College Group’s, To Help Them !