SlideShare a Scribd company logo
1 of 2
What is the meaning of the keyword this? Explain why it is valid only in the implementation of a
member function
Solution
This Keyword : It refers to the current object.Used to invoke local and global variables and
member functions like constructors.
Here is the usage of this keyword in java.
In java class  we are having member functions .we can implement those member functions
using this keyword only.Here member functions are nothing but methods in java programming.
Let us consider sample java program to implementation of a member function using this
keyword.Here in below java program we are taking member functions as constructors.
Program:
import java.io.*;
class Thiskeyword
{
public int i;
public Thiskeyword() // member function of Thiskeyword
{
this(20); //must be the first statement , calling the constructor
System.out.println(" t THIS() Constructor is called");
i=10;
System.out.println(" t the value of i= "+i);
}
public Thiskeyword(int i) //member function with parameters
{
System.out.println(" t THIS(int j) constructor is called");
this.i=i; //pointing to the current class member
System.out.println(" t the value of i= "+i);
}
}
class This // main class
{
public static void main(String a[])throws IOException
{
System.out.println(" t start of main()");
Thiskeyword t=new Thiskeyword();
System.out.println(" t end of main()");
}
}
Output:
start of main()
THIS(int j) constructor is called
the value of i=20
THIS() constructor is called
the value of i=10
end of main()

More Related Content

Similar to What is the meaning of the keyword this- Explain why it is valid only.docx

Constructor destructor.ppt
Constructor destructor.pptConstructor destructor.ppt
Constructor destructor.pptKarthik Sekar
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 
Lecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxLecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxrayanbabur
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfStephieJohn
 
Java ppt Gandhi Ravi (gandhiri@gmail.com)
Java ppt  Gandhi Ravi  (gandhiri@gmail.com)Java ppt  Gandhi Ravi  (gandhiri@gmail.com)
Java ppt Gandhi Ravi (gandhiri@gmail.com)Gandhi Ravi
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for MainframersRich Helton
 
Introduction
IntroductionIntroduction
Introductionrichsoden
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptxsyedabbas594247
 
Core java notes with examples
Core java notes with examplesCore java notes with examples
Core java notes with examplesbindur87
 
Java: Inheritance
Java: InheritanceJava: Inheritance
Java: InheritanceTareq Hasan
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6comp274
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6solutionjug4
 
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docxBroncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docxcurwenmichaela
 

Similar to What is the meaning of the keyword this- Explain why it is valid only.docx (20)

java basic .pdf
java basic .pdfjava basic .pdf
java basic .pdf
 
DAY_1.1.pptx
DAY_1.1.pptxDAY_1.1.pptx
DAY_1.1.pptx
 
Constructor destructor.ppt
Constructor destructor.pptConstructor destructor.ppt
Constructor destructor.ppt
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Lecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptxLecture-11 Friend Functions and inline functions.pptx
Lecture-11 Friend Functions and inline functions.pptx
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
Java ppt Gandhi Ravi (gandhiri@gmail.com)
Java ppt  Gandhi Ravi  (gandhiri@gmail.com)Java ppt  Gandhi Ravi  (gandhiri@gmail.com)
Java ppt Gandhi Ravi (gandhiri@gmail.com)
 
Java for Mainframers
Java for MainframersJava for Mainframers
Java for Mainframers
 
java tr.docx
java tr.docxjava tr.docx
java tr.docx
 
Java introduction
Java introductionJava introduction
Java introduction
 
Lombok
LombokLombok
Lombok
 
Spring boot
Spring bootSpring boot
Spring boot
 
Introduction
IntroductionIntroduction
Introduction
 
object oriented programming language.pptx
object oriented programming language.pptxobject oriented programming language.pptx
object oriented programming language.pptx
 
Core java notes with examples
Core java notes with examplesCore java notes with examples
Core java notes with examples
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Java: Inheritance
Java: InheritanceJava: Inheritance
Java: Inheritance
 
Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6Cis 355 ilab 1 of 6
Cis 355 ilab 1 of 6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docxBroncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
Broncosbuild.xmlBuilds, tests, and runs the project Broncos..docx
 

More from dorisc7

(TCO 2) Which of the following project management activities is associ.docx
(TCO 2) Which of the following project management activities is associ.docx(TCO 2) Which of the following project management activities is associ.docx
(TCO 2) Which of the following project management activities is associ.docxdorisc7
 
(TCO 1) Who are the users of managerial accounting information- How do.docx
(TCO 1) Who are the users of managerial accounting information- How do.docx(TCO 1) Who are the users of managerial accounting information- How do.docx
(TCO 1) Who are the users of managerial accounting information- How do.docxdorisc7
 
(Subsequent events) Green- CPA- is auditing the financial statements o.docx
(Subsequent events) Green- CPA- is auditing the financial statements o.docx(Subsequent events) Green- CPA- is auditing the financial statements o.docx
(Subsequent events) Green- CPA- is auditing the financial statements o.docxdorisc7
 
(Reliability engineering) Make a list of six population stereotypical.docx
(Reliability engineering) Make a list of six population stereotypical.docx(Reliability engineering) Make a list of six population stereotypical.docx
(Reliability engineering) Make a list of six population stereotypical.docxdorisc7
 
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docxdorisc7
 
-Java programming- Write a class named Junior-java Inherits the Stud.docx
-Java programming-  Write a class named Junior-java  Inherits the Stud.docx-Java programming-  Write a class named Junior-java  Inherits the Stud.docx
-Java programming- Write a class named Junior-java Inherits the Stud.docxdorisc7
 
--Social Organizations and Core Competencies-- Please respond to the f.docx
--Social Organizations and Core Competencies-- Please respond to the f.docx--Social Organizations and Core Competencies-- Please respond to the f.docx
--Social Organizations and Core Competencies-- Please respond to the f.docxdorisc7
 
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docxdorisc7
 
- Answer the following questions about acids 1- What is the phase of a.docx
- Answer the following questions about acids 1- What is the phase of a.docx- Answer the following questions about acids 1- What is the phase of a.docx
- Answer the following questions about acids 1- What is the phase of a.docxdorisc7
 
- At time 110 four processes (P1 P4) are waiting for a timeout signal.docx
- At time 110 four processes (P1  P4) are waiting for a timeout signal.docx- At time 110 four processes (P1  P4) are waiting for a timeout signal.docx
- At time 110 four processes (P1 P4) are waiting for a timeout signal.docxdorisc7
 
(70 pts) Nuclear History Identify the event in nuclear history that oc.docx
(70 pts) Nuclear History Identify the event in nuclear history that oc.docx(70 pts) Nuclear History Identify the event in nuclear history that oc.docx
(70 pts) Nuclear History Identify the event in nuclear history that oc.docxdorisc7
 
(2) The CPU incorporates several major components (as shown in Fig- de.docx
(2) The CPU incorporates several major components (as shown in Fig- de.docx(2) The CPU incorporates several major components (as shown in Fig- de.docx
(2) The CPU incorporates several major components (as shown in Fig- de.docxdorisc7
 
(Audit evidence) The third GAAS of field work requires that the audito.docx
(Audit evidence) The third GAAS of field work requires that the audito.docx(Audit evidence) The third GAAS of field work requires that the audito.docx
(Audit evidence) The third GAAS of field work requires that the audito.docxdorisc7
 
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docx
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docxWhat is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docx
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docxdorisc7
 
What is the concept of sustainable income- Please describe it in your.docx
What is the concept of sustainable income- Please describe it in your.docxWhat is the concept of sustainable income- Please describe it in your.docx
What is the concept of sustainable income- Please describe it in your.docxdorisc7
 
What is the backbone for the Internet- Briefly describe how the Intern.docx
What is the backbone for the Internet- Briefly describe how the Intern.docxWhat is the backbone for the Internet- Briefly describe how the Intern.docx
What is the backbone for the Internet- Briefly describe how the Intern.docxdorisc7
 
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docx
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docxWhat is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docx
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docxdorisc7
 
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docx
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docxwhat is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docx
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docxdorisc7
 
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docx
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docxWhat is the pH of a 0-114 M solution of the acid HA if its ionization (1).docx
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docxdorisc7
 
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docx
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docxWhat is the minimum number of nodes in an AVL tree of height 8- Let N(.docx
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docxdorisc7
 

More from dorisc7 (20)

(TCO 2) Which of the following project management activities is associ.docx
(TCO 2) Which of the following project management activities is associ.docx(TCO 2) Which of the following project management activities is associ.docx
(TCO 2) Which of the following project management activities is associ.docx
 
(TCO 1) Who are the users of managerial accounting information- How do.docx
(TCO 1) Who are the users of managerial accounting information- How do.docx(TCO 1) Who are the users of managerial accounting information- How do.docx
(TCO 1) Who are the users of managerial accounting information- How do.docx
 
(Subsequent events) Green- CPA- is auditing the financial statements o.docx
(Subsequent events) Green- CPA- is auditing the financial statements o.docx(Subsequent events) Green- CPA- is auditing the financial statements o.docx
(Subsequent events) Green- CPA- is auditing the financial statements o.docx
 
(Reliability engineering) Make a list of six population stereotypical.docx
(Reliability engineering) Make a list of six population stereotypical.docx(Reliability engineering) Make a list of six population stereotypical.docx
(Reliability engineering) Make a list of six population stereotypical.docx
 
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
(JAVA NetBeans) Write a Java program able to perform selection sort-So.docx
 
-Java programming- Write a class named Junior-java Inherits the Stud.docx
-Java programming-  Write a class named Junior-java  Inherits the Stud.docx-Java programming-  Write a class named Junior-java  Inherits the Stud.docx
-Java programming- Write a class named Junior-java Inherits the Stud.docx
 
--Social Organizations and Core Competencies-- Please respond to the f.docx
--Social Organizations and Core Competencies-- Please respond to the f.docx--Social Organizations and Core Competencies-- Please respond to the f.docx
--Social Organizations and Core Competencies-- Please respond to the f.docx
 
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx
-- I have two classes One is Carnivore and the other is Herbivore- Eac.docx
 
- Answer the following questions about acids 1- What is the phase of a.docx
- Answer the following questions about acids 1- What is the phase of a.docx- Answer the following questions about acids 1- What is the phase of a.docx
- Answer the following questions about acids 1- What is the phase of a.docx
 
- At time 110 four processes (P1 P4) are waiting for a timeout signal.docx
- At time 110 four processes (P1  P4) are waiting for a timeout signal.docx- At time 110 four processes (P1  P4) are waiting for a timeout signal.docx
- At time 110 four processes (P1 P4) are waiting for a timeout signal.docx
 
(70 pts) Nuclear History Identify the event in nuclear history that oc.docx
(70 pts) Nuclear History Identify the event in nuclear history that oc.docx(70 pts) Nuclear History Identify the event in nuclear history that oc.docx
(70 pts) Nuclear History Identify the event in nuclear history that oc.docx
 
(2) The CPU incorporates several major components (as shown in Fig- de.docx
(2) The CPU incorporates several major components (as shown in Fig- de.docx(2) The CPU incorporates several major components (as shown in Fig- de.docx
(2) The CPU incorporates several major components (as shown in Fig- de.docx
 
(Audit evidence) The third GAAS of field work requires that the audito.docx
(Audit evidence) The third GAAS of field work requires that the audito.docx(Audit evidence) The third GAAS of field work requires that the audito.docx
(Audit evidence) The third GAAS of field work requires that the audito.docx
 
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docx
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docxWhat is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docx
What is the Big Bang-SolutionBig Bang is a theory which talks ababo th.docx
 
What is the concept of sustainable income- Please describe it in your.docx
What is the concept of sustainable income- Please describe it in your.docxWhat is the concept of sustainable income- Please describe it in your.docx
What is the concept of sustainable income- Please describe it in your.docx
 
What is the backbone for the Internet- Briefly describe how the Intern.docx
What is the backbone for the Internet- Briefly describe how the Intern.docxWhat is the backbone for the Internet- Briefly describe how the Intern.docx
What is the backbone for the Internet- Briefly describe how the Intern.docx
 
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docx
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docxWhat is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docx
What is the pH of a 0-1 M aqueous solution of NaH2PO4SolutionNaH2PO4 -.docx
 
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docx
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docxwhat is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docx
what is the ph of a 0-16M NaF(aq) solution-SolutionNaF(aq) -----------.docx
 
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docx
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docxWhat is the pH of a 0-114 M solution of the acid HA if its ionization (1).docx
What is the pH of a 0-114 M solution of the acid HA if its ionization (1).docx
 
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docx
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docxWhat is the minimum number of nodes in an AVL tree of height 8- Let N(.docx
What is the minimum number of nodes in an AVL tree of height 8- Let N(.docx
 

Recently uploaded

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 

Recently uploaded (20)

18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 

What is the meaning of the keyword this- Explain why it is valid only.docx

  • 1. What is the meaning of the keyword this? Explain why it is valid only in the implementation of a member function Solution This Keyword : It refers to the current object.Used to invoke local and global variables and member functions like constructors. Here is the usage of this keyword in java. In java class  we are having member functions .we can implement those member functions using this keyword only.Here member functions are nothing but methods in java programming. Let us consider sample java program to implementation of a member function using this keyword.Here in below java program we are taking member functions as constructors. Program: import java.io.*; class Thiskeyword { public int i; public Thiskeyword() // member function of Thiskeyword { this(20); //must be the first statement , calling the constructor System.out.println(" t THIS() Constructor is called"); i=10; System.out.println(" t the value of i= "+i); } public Thiskeyword(int i) //member function with parameters { System.out.println(" t THIS(int j) constructor is called"); this.i=i; //pointing to the current class member System.out.println(" t the value of i= "+i); } }
  • 2. class This // main class { public static void main(String a[])throws IOException { System.out.println(" t start of main()"); Thiskeyword t=new Thiskeyword(); System.out.println(" t end of main()"); } } Output: start of main() THIS(int j) constructor is called the value of i=20 THIS() constructor is called the value of i=10 end of main()