[JAVA-621] Fixes due to minor article changes

* Renamed KeywordUnitTest to Keyword as it's the chosen name for the
article now
This commit is contained in:
dupirefr 2020-04-11 10:27:16 +02:00
parent b117f4ccd6
commit c02e57fe7e
1 changed files with 7 additions and 7 deletions

View File

@ -1,17 +1,17 @@
package com.baeldung.keyword.thiskeyword;
public class KeywordUnitTest {
public class Keyword {
private String name;
private int age;
public KeywordUnitTest() {
public Keyword() {
this("John", 27);
this.printMessage();
printInstance(this);
}
public KeywordUnitTest(String name, int age) {
public Keyword(String name, int age) {
this.name = name;
this.age = age;
}
@ -20,11 +20,11 @@ public class KeywordUnitTest {
System.out.println("invoked by this");
}
public void printInstance(KeywordUnitTest thisKeyword) {
public void printInstance(Keyword thisKeyword) {
System.out.println(thisKeyword);
}
public KeywordUnitTest getCurrentInstance() {
public Keyword getCurrentInstance() {
return this;
}
@ -33,8 +33,8 @@ public class KeywordUnitTest {
boolean isInnerClass = true;
public ThisInnerClass() {
KeywordUnitTest thisKeyword = KeywordUnitTest.this;
String outerString = KeywordUnitTest.this.name;
Keyword thisKeyword = Keyword.this;
String outerString = Keyword.this.name;
System.out.println(this.isInnerClass);
}
}