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 : What is Break statement Break statement

    Break statement: A statement employed to break out of a loop, switch statement or labeled block. In all situations, control continues with the statement instantly, subsequent to the containing block.

  • Q : What is Shallow copy Shallow copy : It

    Shallow copy: It is a copy of an object in which copies of each and every object's sub-components are not as well made. For example, a shallow copy of an array of objects would outcome in two separate array objects, each having references to similar s

  • Q : What is Octal character constant Octal

    Octal character constant: It is a character constant in the form of \ddd, where each d is an octal digit. This might be employed for characters with a Unicode value in the range of 0 to 255.

  • Q : Windows Communication Foundation or WCF

    Why did Microsoft develop the Windows Communication Foundation (WCF) technology?

  • Q : Recursive Matlab function Write a

    Write a recursive Matlab function TriUVRCol that solves a virtually upper triangular system of equations accessing the matrix by column. Write another recursive Matlab function LUPivRec that recursively computes the LU decomposition of a matrix using partial pivoting.

  • Q : Define the term Top level class Define

    Define the term Top level class: It is a class defined either at outermost level of a package or the static nested class.

  • Q : Define Continuous simulation Continuous

    Continuous simulation: In a continuous simulation, the time ticks past at a regular rate which is applicable to the specific simulation scenario. At each and every tick, all the objects in the simulation are informed of the passage of time and updated

  • Q : Define Function Function : The name

    Function: The name given to assembly of statements which does some particular task and might return a value. Function can be invoked (or called) any number of time and anywhere in the program.

  • Q : Define Undeniable Signature Scheme

    Define Undeniable Signature Scheme?

  • Q : Explain For loop For loop : This is one

    For loop: This is one of the Java's three control structures employed for looping. The other two are while loop and do loop. A for loop includes of a loop header and a loop body. The header comprises of three expressions separated by two semicolons an

©TutorsGlobe All rights reserved 2022-2023.