Explain This

This: It is a Java reserved word with numerous different uses:

A) Within a constructor, it might be employed as the first statement to call the other constructor in similar class. For illustration:

              // Initialize with default values.
              public Heater()
              {
                  // Use another constructor.
                  this(15, 20);
              }

              // Initialize with the given values.
              public Heater(int min,int max)
              {
                  ...
              }
             
B) Within a method or constructor, it might be employed to distinguish between a field and a parameter or method variable of similar name. For example:

              public Heater(int min,int max)
              {
                  this.min = min;
                  this.max = max;
                  ...
              }
             
C) It can be employed as a reference to the present object, usually in order to pass the reference to the other object:
               talker.talkToMe(this);

   Related Questions in Programming Languages

  • Q : Difference between collection and arrays

    Write the difference between collection and arrays?

  • Q : Define Reserved word Reserved word : It

    Reserved word: It is a word reserved for a particular purpose in Java, like: class, int, public, and so forth. These words might not be employed as ordinary identifiers.

  • Q : What is Class Selector in the CSS

    Explain what is meant by the Class Selector in the CSS?

  • Q : Define class Define class?

    Define class?

  • Q : Tower of Hanoi Puzzle program using C#

    Tower of Hanoi Puzzle program using C# and Windows Presentation Foundation (WPF) template in Visual Studio 2012 or newer.

  • Q : What is an Anonymous array Anonymous

    Anonymous array: It is an array formed without an identifier. The anonymous array is generally formed as an actual argument, for example:// generate an anonymous array of integers.    YearlyRainfall y2k = new YearlyRai

  • Q : What is Left shift operator Left shift

    Left shift operator: Left shift operator (<<) is the bit manipulation operator. This moves the bits in its left operand zero or additional positions to the left, according to the value of its right operand. The zero bits are added up to the righ

  • Q : Define Zip file Zip file : It is a file

    Zip file: It is a file employed to store compressed versions of the files. In connection with Java bytecode files, such have mostly been superseded by the Java Archive (abbreviated as JAR) files.

  • Q : Define Octal Octal : Number

    Octal: Number representation of octal is base 8. In base 8, simply the digits 0 to 7 are employed. Digit positions symbolize successive powers of 8.

  • Q : Define Hexadecimal Hexadecimal : Number

    Hexadecimal: Number representation in hexadecimal is base 16. In base 16, the digits 0-9 and the letters A to F are utilized. A symbolizes 10 (base 10), B symbolizes 11 (base 10), and so forth. Digit positions symbolize successive pow

©TutorsGlobe All rights reserved 2022-2023.