Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Home.this</strong></p> <p><code>Home.this</code> refers to the current instance of the <code>Home</code> class.</p> <p>The formal term for this expression appears to be the <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.8.4" rel="noreferrer">Qualified this</a>, as referenced in Section 15.8.4 of the Java Language Specification.</p> <p>In a simple class, saying <code>Home.this</code> and <code>this</code> will be equivalent. This expression is only used in cases where there is an inner class, and one needs to refer to the enclosing class.</p> <p>For example:</p> <pre><code>class Hello { class World { public void doSomething() { Hello.this.doAnotherThing(); // Here, "this" alone would refer to the instance of // the World class, so one needs to specify that the // instance of the Hello class is what is being // referred to. } } public void doAnotherThing() { } } </code></pre> <p><strong>Home.class</strong></p> <p><code>Home.class</code> will return the representation of the <code>Home</code> class as a <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html" rel="noreferrer"><code>Class</code></a> object.</p> <p>The formal term for this expression is the <a href="http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.8.2" rel="noreferrer">class literal</a>, as referenced in Section 15.8.2 of the Java Language Specification.</p> <p>In most cases, this expression is used when one is using <a href="http://download.oracle.com/javase/tutorial/reflect/index.html" rel="noreferrer">reflection</a>, and needs a way to refer to the class itself rather than an instance of the class.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload