UrbanPro

Learn Java Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is the use of the "this" keyword in Java?

Asked by Last Modified  

9 Answers

Learn Java

Follow 6
Answer

Please enter your answer

'this' refer the current instance of a class. You can get and set data members of current object using 'this' prefix inside there class data type.
Comments

Private Online Java Training by Exp Software Engineer

The 'this' keyword in Java is a reference variable that refers to the current class object. 'this' keyword can be used to refer current class instance variable 'this' can be used to invoke or initiate current class constructor It can be used to return the current class instance 'this' can be passed as...
read more
The 'this' keyword in Java is a reference variable that refers to the current class object. 'this' keyword can be used to refer current class instance variable 'this' can be used to invoke or initiate current class constructor It can be used to return the current class instance 'this' can be passed as an argument in the method call 'this' can be passed as argument in the constructor call read less
Comments

Java Tutor

class xyz{ int x; int y; xyz (int x,int y){ this.x=x; this.y=y; } Used to specify current class object
Comments

Programmer

"This" is a keyword it refers to the current object E.g if your method variable name is same as your reference variable name then we use "this" keyword to tell the compiler that i am using reference variable not method variable For Core Java Training You can visit and Send a Enquiry on my Profile...
read more
"This" is a keyword it refers to the current object E.g if your method variable name is same as your reference variable name then we use "this" keyword to tell the compiler that i am using reference variable not method variable For Core Java Training You can visit and Send a Enquiry on my Profile on UrbanPro http://ubpro.in/C67fasiy Vivek read less
Comments

In java 'this ' keyword is used to access property of current class eg. using 'this' keyword current iinstance variable of class is accessible.
Comments

Web Engineer

this can be used to refer current class instance variable. this can be used to invoke current class method (implicitly) this() can be used to invoke current class constructor. this can be passed as an argument in the method call. this can be passed as argument in the constructor call. this can be used...
read more
this can be used to refer current class instance variable. this can be used to invoke current class method (implicitly) this() can be used to invoke current class constructor. this can be passed as an argument in the method call. this can be passed as argument in the constructor call. this can be used to return the current class instance from the method. read less
Comments

Keyword 'THIS' in Java is a reference variable that refers to the current object. It can be used to refer current class instance variable.
Comments

Java Professional

actually "this" keyword resolve the ambiguity between the current instance variable and the constructor parameter, also keeping both the parameters with same name is not a good practice anymore as well. So better way is to make your constructor parameter with name starting with "p" where "p" stands for...
read more
actually "this" keyword resolve the ambiguity between the current instance variable and the constructor parameter, also keeping both the parameters with same name is not a good practice anymore as well. So better way is to make your constructor parameter with name starting with "p" where "p" stands for parameter. In that case your code will run with out "this" as well. read less
Comments

Tutor

"this" is a refernce variable that refers to the current object. "this" keyword is used to refer current class instance variable in a conctructor and a method which has called the method.
Comments

View 7 more Answers

Related Questions

What is difference between Multithreading and miltiprocessing?
It is simple to understand. You question itself contains the answer. Only the keynote is: A single processor/core of the cpu can execute single task at a time, not more than one task. And you should...
Milan
Is it good to go for a Java coaching center and learn Java (with advanced Java) to improve my programming skills?
yes, Please check the Institute reviews and discuss with the tutor, what topics were covered in class. Ask about the practicals session and how many hours/duration of the course.
Gerda
0 0
5
What are the best websites to learn java as well as get a certificate from them?
To learn basic java i suggest javatpoint is good for knowledge as well as concept but for certification refer book
Abirami
0 0
7
Java was developed in which year?
1995 By Sir James Gosling
Mohit
0 1
8

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

jOOQ 3.10 Supports JPA Attribute Converter
One of the cooler hidden features in jOOQ is the JPADatabase, which allows for reverse engineering a pre-existing set of JPA-annotated entities to generate jOOQ code. For instance, you could write these...

Java 8 Predicates
In the previous lession, we have learnt how to use filters and collectors. In filter we have passed the condition to evaluate whether the object is eligible to be filtered or not. Code given below for...


Java Overview
Java platform overview Java platform components The Java platform consists of the following components. The Java language Like any programming language, the Java language has its own structure, syntax...
A

Akshay Shende

0 0
0

Java : Compile-time Versus Runtime optimization
While designing and development, one should think in terms of compile-time and run-time.It helps in understanding language basics in a better way.Let's understand this with a question below : What...
S

Recommended Articles

Designed in a flexible and user-friendly demeanor, Java is the most commonly used programming language for the creation of web applications and platform. It allows developers to “write once, run anywhere” (WORA). It is general-purpose, a high-level programming language developed by Sun Microsystem. Initially known as an...

Read full article >

Before we start on the importance of learning JavaScript, let’s start with a short introduction on the topic. JavaScript is the most popular programming language in the world, precisely it is the language - for Computers, the Web, Servers, Smart Phone, Laptops, Mobiles, Tablets and more. And if you are a beginner or planning...

Read full article >

Java is the most commonly used popular programming language for the creation of web applications and platform today. Integrated Cloud Applications and Platform Services Oracle says, “Java developers worldwide has over 9 million and runs approximately 3 billion mobile phones”.  Right from its first implication as java 1.0...

Read full article >

In the domain of Information Technology, there is always a lot to learn and implement. However, some technologies have a relatively higher demand than the rest of the others. So here are some popular IT courses for the present and upcoming future: Cloud Computing Cloud Computing is a computing technique which is used...

Read full article >

Looking for Java Training Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for Java Training Classes?

The best tutors for Java Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Java Training with the Best Tutors

The best Tutors for Java Training Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more