this keyword:
class Student{
int rollno;
String name;
float school fees;
Student(int rollno,String name,float school fees){
this.rollno=rollno;
this.name=name;
this.school fees=school fees;
}
void display(){System.out.println(rollno+" "+name+" "+school fees);}
}
class TestThis2{
public static void main(String args[]){
Student s1=new Student(220,"Divya",10000f);
Student s2=new Student(330,"Mitra",20000f);
s1.display();
s2.display();
}}
220 Divya 10000
330 Mitra 20000
class Student{
int rollno;
String name;
float school fees;
Student(int r,String n,float s.f){
rollno=r;
name=n;
school fees=s.f;
}
void display(){System.out.println(rollno+" "+name+" "+school fees);}
}
class TestThis3{
public static void main(String args[]){
Student s1=new Student(220,"Divya",10000f);
Student s2=new Student(330,"Mitra",20000f);
s1.display();
s2.display();
}}
220 Divya 10000
330 Mitra 20000