Earn by twitter on twivert

Sign up for PayPal and start accepting credit card payments instantly.
Showing posts with label inheritance. Show all posts
Showing posts with label inheritance. Show all posts

Sunday, May 2, 2010

To display student record’s thrg inheri


/*To display student record’s thrg inheri*/
/*Save as: inherited*/

import java.lang.*;
class Student_information
{
   int id;
   String name,addr;
   Student_information(int id,String name,String addr)
     {
     this.id=id;
     this.name=name;
     this.addr=addr;
     }
   void display()
     {
     System.out.println("information of student");
     System.out.println("id"+id);
     System.out.println("name"+name);
     System.out.println("address"+addr);
     }
}
class Student_record extends Student_information
{
   String branch,sem;
   Student_record(int id,String name,String addr,String branch,String sem)
   Super(id,name,addr);
   {
   this.branch=branch;
   this.sem=sem;
   }
   void display()
   {
   display();
   System.out.println("student record");
   System.out.println("branch"+branch);
   System.out.println("sem"+sem);
   }
}
class inherited
{
    public static void main(String args[])
      {
      Student_record s1=new Student_record(47,"student A","har","bca","second");
      Student_record s2=new Student_record(49,"student B","mah","bca","second");
      Student_record s3=new Student_record(11,"student C","delhi","cs","third");
      
      s1.display();
      s2.display();
      s3.display();
      
      }
}

ADS

How to earn online

How to earn online:
Step - 1 :
signup for PayPal, to recieve your online earning
click here:
https://www.paypal.com/in/mrb/pal=CZ7224TZBMCBL
step - 2 : Singup these 4 sites & earn & enjoy! Read site to know how to earn.
1. trekpay
Earn up to $0.02 (2 cents) per click.
http://www.trekpay.com/?ref=34690
2. neobux
Earn up to $0.02 (2 cents) per click.
Click here:
http://www.neobux.com/?r=Moneyearner786

AddMe

Bookmark and Share