Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

The this(Keyword)

public class Person {
    String name;
    int age;
    char gender;
    public Person(String name, int age, char gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }
}
Comment

this keyword

 this keyword : 
               this represent owner that is object i.e Person which has properties like name, age etc.
this keyword in class/struct also represents owner that is object. if we made two objects of a class, then this keyword represents original object owner.
Comment

PREVIOUS NEXT
Code Example
Java :: delet file from path android 
Java :: Cannot find a class with the main method. 
Java :: Calling User-Defined Method in Java 
Java :: java try with resources 
Java :: infinite for loop java example 
Java :: spring boot swagger ui 401 
Java :: reverse number in java 
Java :: hibernate in spring boot 
Java :: java initialize object array 
Java :: hashmap in java 
Java :: vscode code formatter cannot format 
Java :: jpa page sort 
Java :: minimum and maximum in array in java 
Java :: javafx fxmlloader location is not set 
Java :: tableau deux dimensions java 
Java :: Java Hashmap Add Elements 
Java :: Java The Throw/Throws Keyword 
Java :: binary to decimal java 
Java :: lauch java batch 
Java :: java double to float 
Java :: java method overriding 
Java :: Java Thread Example by implementing Runnable interface 
Java :: method parameters in java 
Java :: How to merge two sorted arrays in Java? 
Java :: array reverse in java 
Java :: startactivity not working in android adapter 
Java :: type variable java 
Java :: how to create Java ArrayList 
Java :: thread in java 
Java :: reader from string java 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =