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

simple way to explane the servlet in java
Servlet is a program wich executed in server and assists in responding to client queries..... Usually confidential tasks are done by using servlets or other server side codes
Anish
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
How many years of experience should a good Java trainer need?
Minimum 4 years, actually it depends how much exposure you got and how you worked in project(s)
Nayan
0 0
5
What is a good foundation course for JAVA?
I will not prefer any programming language or technology instead, You can focus on Concept and Principles. Because when you say your a programmer you should be a programmer rather than saying Java programmer,...
Rajeev J
what is serialVersionUID , why it different for each bean? serialVersionUID = 42L;
The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized...
Srilatha N

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...

Android : Application Launch time improvements.
For any standard android application, below 3 components play important roles to show 1st interface to user, so that he/she can interact with the app. 1. Custom Application class : Intialize the components...

Java Training Syllabus
Learn JAVA-J2EE Syllabus Core Java - Syllabus aligned to OCA Exam - JDK 8 Object-Oriented Programming (OOPS) concepts: Programming Languages Object Oriented Programming Classes & Objects Pillars...

Priority in TestNG
public class Priority { @Test (priority=1)public void login() {System.out.println("login");} @Testpublic void email1() {System.out.println("email1");} @Test (priority=-2)public void email2() {System.out.println("email2");} //I...
S

Sarthak C.

0 0
0

Definition of Class and Object in Java
Object - Objects have states and behaviors. Example: A dog has states - colour, name, breed as well as behaviors - barking, eating, sleeping. An object is an instance of a class. Class - A class can be...

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