Home Answers Viewqa Java-Beginners meaning of "this" keyword in statements addActionListener(this)

 
 


venkateshmadisetty
meaning of "this" keyword in statements addActionListener(this)
1 Answer(s)      a year ago
Posted in : Java Beginners

meaning of "this" keyword in statements addActionListener(this)?

View Answers

May 8, 2012 at 1:18 PM


Basically, this keyword is used to refer the current instance of the method on which it is used. In the specified statement, object b1 is making a method call addActionListener in which the argument passed is the method invoking object it self which is represent by "this" ie "this" refers to the b1.

In other words, "this" represents the action listener is defined in the same class itself not outside the class. It means your class has implemented the interface ActionListener, therefore this statement is needed.









Related Pages:
Keyword - this
Keyword - this       A keyword is a word having a particular meaning to the programming language. Similarly, this keyword is used to represent an object constructed from a class
try Java Keyword
try Java Keyword       The try is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
synchronized Java Keyword
synchronized Java Keyword       The synchronized is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning
The if Keyword
The if Keyword         The if is a keyword, which is used to perform the selection statement. It is used to execute the statements after evaluating the condition
The for Keyword
The for Keyword       The for is Java keyword that is used to execute a block of code continuously to accomplish a particular condition. The for loop specifies the statements
The else Keyword
The else Keyword        The else is the one more keyword of Java. It is used to specify a statement or block of statements that are executed when the condition for testing specified
this java keyword
this java keyword       "this" is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
The While keyword
The While keyword       While is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
The void keyword
The void keyword       The void is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
The volatile keyword
The volatile keyword       The volatile is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
java
meaning of "this" keyword in statements addActionListener(this)  meaning of "this" keyword in statements addActionListener(this)?   Basically, this keyword is used to refer the current instance of the method on which
problem with addactionlistener on JComboBox - Java Beginners
problem with addactionlistener on JComboBox  ViewElements.java:225: expected jccourse.addActionListener(new ActionListener.... You can use addActionListener() on Combo Box in the following way: import
while Java Keyword
while Java Keyword       The while is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant
true Java Keyword
true Java Keyword       The true is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
volatile Java Keyword
volatile Java Keyword       The volatile is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant
The implement keyword
The implement keyword       In java programming language, the keyword implement specifies... which have specific meaning relevant to a compiler. Syntax: Here is the syntax
Java Control Statements
statements. The keyword "switch" is  followed... Java Control Statements     ... the control statements. Different types of control statements: the decision making
void Java Keyword
void Java Keyword       The void is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
transient Java Keyword
transient Java Keyword       The transient is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant
The null keyword
The null keyword       The null keyword in java programming language is a reserved word that is used... meaning relevant to a compiler. Syntex:  Here is the syntax that displays
throws Java Keyword
throws Java Keyword       throws " is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
Meaning of invoice
Meaning of invoice  hello, What is the meaning of invoice?   hii, Invoice is a statement which contains the following listed things. Invoice Number Invoice date Name and address of the person Name and address
super Java Keyword
super Java Keyword       The super is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant
The interface keyword
have specific meaning relevant to a compiler. The keyword implement is used... The interface keyword       In java programming language the keyword interface in java is used
Private Java Keyword
Private Java Keyword       private is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
Public Java Keyword
Public Java Keyword       public is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java
throw Java Keyword
throw Java Keyword       "throw " is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant
Return Java Keyword
Return Java Keyword       The return is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
The new keyword
meaning relevant to a compiler. The new keyword allocates new objects... The new keyword       The new keyword in java programming language is used to create a new instance
The package keyword
The package keyword       The package in java programming language is a keyword that is used to define... which have specific meaning relevant to a compiler. Packages in java are used
Protected Java Keyword
Protected Java Keyword       protected is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
static Java Keyword
static Java Keyword       The static is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
short Java Keyword
short Java Keyword       The short is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
The long keyword
The long keyword       long is a keyword in java that is used to store 64-bit integer (Java primitive type) value. Keywords are basically reserved words which have specific meaning
The int keyword
specific meaning relevant to a compiler. The keyword int in java programming language... The int keyword       The int is a keyword in java that is used to define 32-bit signed integer
The instance of keyword
The instance of keyword       The keyword instanceOf in java programming language... which have specific meaning relevant to a compiler. It takes an object reference
switch Java Keyword
switch Java Keyword       The switch is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler
Case Java Keyword
Case Java Keyword       The java keyword "case" is used to label each branch in the switch statement in java program. In other word Case is a java keyword
Table Maintenance Statements
Table Maintenance Statements     ... The message If you are not using optional keyword NO_WRITE_TO_BINGLOG..., MyISAM and ARCHIVE tables. This statements is used to check views also
Account Management Statements
Account Management Statements     ... the PASSWORD keyword. But when you specify the PASSWORD keyword then password... GRANTS statements for determining the account has what type of privileges. 
what is the meaning of abstract?
what is the meaning of abstract?  what is the meaning of abstract
MySQL Transactional and Locking Statements
MySQL Transactional and Locking Statements       MySQL5.0 supports local transactions by statements... a group of SQL Statements, which executes as a unit. And MySQL either executes all
what is the meaning this coad?
what is the meaning this coad?  what is the meaning this coad? Example Form example form = (Example Form) form
Decision-making Statements in java 7
Decision-making Statements in java 7 In this section, we will discuss about Decision-making Statements in java 7. This is one type of control flow statement. Decision-making Statements : This kind of control statements is used where
Static keyword in public static void main
Static keyword in public static void main  Hi, I have seen that on page mentioned below for static keyword explanation given is: Page: http...: static keyword indicates that this method can be invoked simply by using the name
what is the meaning of this or explain this
what is the meaning of this or explain this  List<Object[]> list=query.list();   Hi Friend, It will return the query values in the form of list. For more information, visit the following link: Hibernate
MEANING OF THe CODE IN BOLD LETTERS
MEANING OF THe CODE IN BOLD LETTERS  public static void main(sting args[]) { shape s[] = {new circle(),new rectangle()}; } //HERE SHAPE RECTANGLE AND CIRCLE ARE THREE CLASSES WHICH ARE DEFINED EARLIER IN THE PROGRAM
JavaScript Statements
JavaScript Statements      ...;/HTML> Function  The function keyword identifies as a function... are used by the JavaScript statements inside the curly braces { }. The variable
What is the special meaning of __sleep and __wakeup?
What is the special meaning of __sleep and __wakeup?  What?s the special meaning of _sleep and _wakeup
The do Keyword
are reserved for a Java program. The do is a Java keyword, that may... in your Java program. This keyword is used in control statement to declare a loop... keyword is true; then it exits from the loop when the specified condition

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.