[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

View File

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