Senin, 26 Desember 2016

What is the use of this keyword in programming

In this article, we will look at the uses of this keyword in Java programs along with example Java code.   this Keyword  this keyword in Java is used to refer current object on which a method is invoked. Using such property, we can refer the fields and other methods inside the class of that object. The this keyword has two main uses which are listed below: It is used to eliminate ambiguity between fields and method parameters having the same name. It is used for chaining constructors. To explain the first use, let’s consider the following program, which creates a

The post What is the use of this keyword in programming appeared first on Coding Security.


What is the use of this keyword in programming
read more

Tidak ada komentar:

Posting Komentar