UrbanPro

Learn Java Training from the Best Tutors

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

Search in

Why we are using this keyword in Java?

Asked by Last Modified  

9 Answers

Learn Java

Follow 7
Answer

Please enter your answer

Master of Business Administration (Information System) (Sikkim Manipal University |Apr 2010) Bachelor of Science (Information Technology) (Sikkim Manipal University |Aug 2006)

"this" keyword is use to refer an object of current class it is also use for call specific constructor of current class if more than one constructor is declared.
Comments

Trainer

to access current object
Comments

this keyword in Java is used to refer to the current object.
Comments

Full Stack Apps Engineer (Java)

this is a reference to the current object. Object can contain member variables and those can be accessed from functions using this variable. If a function has parameters name & age and the instance has the same variables then the instance variables will be assigned values using this keyword. The code...
read more
this is a reference to the current object. Object can contain member variables and those can be accessed from functions using this variable. If a function has parameters name & age and the instance has the same variables then the instance variables will be assigned values using this keyword. The code snippet is below. private void private void assignStudentDetails(String name, int age) { this.name = name; // If no this is specified then there will be unexpected error in run time this.age = age; } More details can be found from https://docs.oracle.com/javase/tutorial/java/javaOO/thiskey.html. read less
Comments

THIS is a reference variable in Java that refers to the current object. ... It can be used to refer instance variable of current class. It can be used to invoke or initiate current class constructor. It can be passed as an argument in the method call.
read more

THIS is a reference variable in Java that refers to the current object. ... It can be used to refer instance variable of current class. It can be used to invoke or initiate current class constructor. It can be passed as an argument in the method call.

read less
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

this is a keyword in Java. It can be used inside the Method or constructor of Class. It(this) works as a reference to the current Object whose Method or constructor is being invoked.
Comments

20 years of teaching,academics and engineering

This is used to refer current class object. this with parentheses creates current class constructor
Comments

Computer classes For Working professionals and studne of Engineering, MCA, Class 12,11 class 10

this keyword is refrence keyword that refers to the current obect.
Comments

View 7 more Answers

Related Questions

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
Which is a good Java training and placement institute for a fresher in Bangalore?
I know an institute in HYderabad which is giving 100% job guarantee or 100% fee refund. They have office in bangalore also, not sure whether they are offering this program in Bangalore. Please visit their...
Raja
0 0
5
Can a class have interface and vice-versa?
how its possible both has different meaning you cant enclosed it
Deepa
0 0
7
Which institute is best for java core learning?
For core java RPISE(rajesh patkar classe) is very good . he thought you from the sacratch . i was did there one course, There are lots od students apart from IT backgrounf was came there and they understood...
Hrhrh

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

Ask a Question

Recommended Articles

Java is the most famous programming language till date. 20 years is a big time for any programming language to survive and gain strength. Java has been proved to be one of the most reliable programming languages for networked computers. source:techcentral.com Java was developed to pertain over the Internet. Over...

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 >

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 >

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 >

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