Core Java Example
This Keyword Example
In this example we are using this keyword. This keyword is used to refer the variable is for the method.
SOURCE CODE
class my { private int salary; my(String name,int salary) { this.name=name; this.salary=salary; } public void showData() { System.out.println("Name:"+name+"\n Salary:"+salary); } }
Download Source File