Thursday, 12 February 2015

Solution of this Keyword

  1. class Student11{  
  2.     int id;  
  3.     String name;  
  4.       
  5.     Student11(int id,String name){  
  6.     this.id = id;  
  7.     this.name = name;  
  8.     }  
  9.     void display(){System.out.println(id+" "+name);}  
  10.     public static void main(String args[]){  
  11.     Student11 s1 = new Student11(111,"Karan");  
  12.     Student11 s2 = new Student11(222,"Aryan");  
  13.     s1.display();  
  14.     s2.display();  
  15. }  

No comments:

Post a Comment