Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Pamela Baker   on Aug 08 In Java Category.

  
Question Answered By: Adali Fischer   on Aug 08

i'd like to say that there is a case you must
use "this" keyword this case if the parameter or a function  the same
as the attributes of the class like this example

class Student
{
private String name;
private int age;
private String email;
public Student()
{
name="";
age=0;
email="";
}
public Student(String name,int age,String email)
{
this.name=name;
this.age=age;
this.email=email;
}
}

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on can somebody please explain the function of "this" Or get search suggestion and latest updates.


Tagged: