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 the difference between a C program execution and a Java program execution?
When we compile C program then it convert into exe file ie Machine language with the help of OS lib file which is platform dependent . If we compile java prgram then it convert into class file with the...
Kaushal
0 0
5
If a class contains only a private constructor and no other constructor, is it possible to create object of that class? If yes how?
Yes, It is possible. But, Object can be created only with in that class (either in any method or block).
Shabbir
Is java a frontend or a middleware technology or both?
It's a programming language which is used to write application programs and is independent of platform.
Neha
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
What is an Exception in Java?
Exception is the type of class which we are using in java to check and validate our code. if there is any problem in our code then compiler will throw exception. there are two types of exception. one is...
Piyush
0 0
5

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

Ask a Question

Related Lessons

Method Overloading vs Method Overriding
1. Method Overloading: Method overloading means a same method with same name can have different implementations/body by changing one of the follwing thing: 1) Number of Parameters 2) Order of Parameters 3)...

Why Should We Learn Java Language?
Most of starters has confusion today that which of the programming language should be chosen to work on. It totally depends upon your need. As per my opinion, if you want to grow your career in IT industry...

10 Cool SQL Optimizations That Do Not Depend On The Cost Model
Today, we don’t want to talk about cost based optimisation, i.e. optimisations that depend on a database’s cost model. We’ll look into much simpler optimisations that can be implemented...

Introduction to Course Content
Video about what we are going to learn throughout the Java Training Session .

Simple Input and Output in CoreJava
We can use any of the following options based on the requirements to accept data from the user in corejava and show them Integer Input Output Character Input Output Float Input Output INPUT AND...

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