You are on page 1of 42

Md.

Rashedul Islam
 Keyword THIS is a reference variable in Java that refers to the current object.

2
3
4
5
 Overriding is a feature that allows a subclass or child class to provide a specific implementation
of a method that is already provided by one of its super-classes or parent classes.
 When a method in a subclass has the same name, same parameters or signature and same return
type(or sub-type) as a method in its super-class, then the method in the subclass is said to
override the method in the super-class.

6
 Overriding is a feature that allows a subclass or child class to provide a specific implementation
of a method that is already provided by one of its super-classes or parent classes.
 When a method in a subclass has the same name, same parameters or signature and same return
type(or sub-type) as a method in its super-class, then the method in the subclass is said to
override the method in the super-class.

7
 Method overriding is one of the way by which java achieve Run Time Polymorphism. The version
of a method that is executed will be determined by the object that is used to invoke it.
 If an object of a parent class is used to invoke the method, then the version in the parent class
will be executed, but if an object of the subclass is used to invoke the method, then the version in
the child class will be executed

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Reference Reading:
https://www.tutorialspoint.com/java/lang/java_lang_str
36
ing.htm
37
38
39
Reference Reading:
https://www.tutorialspoint.com/java/lang/java_lang_stringb
40
uffer.htm
41
42

You might also like