answersLogoWhite

0


Best Answer

"Java This keyword" is a reference to the current object, it is very helpful when you need to refer an instance of a particular Object from its available methods or using it's constructor, also "this" keyword helps us to avoid naming conflicts.

The following are different ways to use java this keyword

  • 1) Using with instance variable
  • 2) Using with Constructor
  • 3) Pass / Return current instance
  • Using with instance variable

    Using this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variable

  • Using with instance variable

    Using this keyword inside a method or constructor it will use instance variable instead of local variable, in the absence of this keyword it will use local variable

  • Using with Constructor

    Using this keyword inside constructor like following

    this("Sony", 20);

    it will call the constructor having same parameter

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are the 6 ways to use this keyword?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


Is super keyword is analogous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


What is use of keyword extra in c plus plus programming?

Nothing.


Why you use class keyword in c?

You may use it as an identifier, because it is not a reserved word in C.


What keyword is using to create objects?

In C# and Visual Basic.NET the keyword is "new". C doesn't have such an animal, but you generally use the library call to malloc to get new memory.

Related questions

What is the use of keyword new used in AWT programming?

what is the use of new keyword in awt programming


Which keyword do you use to deallocate memory that has been assigned to a stream object?

Delete keyword


What does google adwords keyword tool mean?

Adwords is an advertising product. It has various ways to advertise text, banners, and rich-media commercials.The AdWords Keyword Tool is an incredibly useful and powerful keyword research tool, built into the AdWords interface. Now it is known as "Keyword Planner". Many Google Partner Agencies like Radon Media as well as businesses who are running online advertising campaigns on Google use this tool to search for keyword and ad group ideas, see how a list of keywords might perform, and even create a new keyword list by multiplying several lists of keywords together. Keyword Planner can also help you choose competitive bids and budgets to use with your campaigns.The AdWords Keyword Planner supports three key use cases:Search for keyword and ad group ideasEnter or upload keywords to get estimatesMultiply keyword lists to get estimates


How much does pay per click internet advertising cost, per click?

Pay per click advertising is one of the best ways to get business for your flower delivery company. The cost per click will depend on the target keyword or keywords you plan to pay for. Use Google Keyword Tool to get a general idea of how much a keyword may cost.


Can you declears static in a local variable in a method in java?

we cannot use the staic keyword inside the method... But we can use the final keyword inside the method....


What is the keyword for district 6 in the hunger games contest?

Transportation.


How many keywords you can use for link building?

You can use many keyword for link building, but you should use an LSI keyword so, you will better to give links on your keyword. The idea is to find as many qualifiers as possible that fit your audience. http://socialseoteam.com/link-building-2015.php


What are 6 ways to use empty tin can?

granade lanchuer


What are the two main ways in which search engines find information?

find a term or a keyword in relative information


Is super keyword is anologous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


Is super keyword is analogous to this keyword in java?

No. The keyword super is used to refer to the parent class instance while the keyword this is used to refer to the current class instance. You need to learn about Inheritance and Object creation using constructors to learn more about these keywords and their use


What is the concept of keyword search strategy about?

'Keyword search strategy' is the method of trying to use the keywords that will most likely help when performing a search on the Internet. For example, using a more common name for a word instead of a less common one and spelling words correctly are two basic ways to get more information.