Home TechnologyProgrammingJava Subscribe to RSS

What Is The Function Of "This Keyword" In Java?

Answer Question

1 Answer - Sort by: Date | Rating

    This keyword is used to differentiate between the function s variable and the class's variable.For Example :
    Class sample{
      int a;
      sample(int a)  -> parameterised constructor
      {
        this.a = a; ->the class 'a variable is assigned the value which is in the function a variable.
    }
    };
    0 0

    Nlgopi 

    answered 7 months ago

      More

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International