What is the use of ?this??

Answer Posted / ashokmail

'this' operator is used to denote the current working
object.

EX:
Class student{
public student(){
this.addStudent();
}
public void addStudent(){
// to do code here
}
public static void main(String args[]){
new student();
}
}

'this' in the constructor is used to denote the current
working object student...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is comparable and comparator interface?

733


What interface is extended by awt event listeners?

785


What two classes are used to read data only?

819


What is var keyword ?

889


How to sort elements in a parallel array in java?

658






Can a class have an interface?

712


Define iterator and methods in iterator?

714


What is use of static method?

717


What is the ==?

643


Differentiate between array list and vector in java.

829


How many types of variables are there?

855


What are parameters in a method?

753


What is the difference between JDBC 1.0 and JDBC 2.0?

2866


How many bytes is a url?

724


What is gc()?

724