Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class Faculty{
- int empid;
- String name;
- String school;
- Faculty(int a,String b,String c){
- this.empid=a;
- name=b;
- school=c;
- }
- }
- class GuestLecture extends Faculty{
- String title;
- String resource;
- String venue;
- int duration;
- String date;
- GuestLecture(String a,String b,String c,String d,int e,String f){
- super(0,d,"unknown");
- title=a;
- resource=b;
- venue=c;
- duration =e;
- date=f;
- }
- void display(){
- System.out.println("name:"+this.name);
- System.out.println("id:"+this.empid);
- System.out.println("resource:"+this.resource);
- System.out.println("venue:"+this.venue);
- System.out.println("duration:"+this.duration);
- System.out.println("Date:"+this.date);
- }
- }
- public class MyClass
- {
- static void show(GuestLecture []x,int n){
- for(int i=0;i<n;++i){
- System.out.println("Guest LEcture "+ i+1);
- x[i].display();
- System.out.println("******");
- }
- }
- public static void main(String[] args) {
- GuestLecture t1=new GuestLecture("hey","hello","atl","ramesh",100,"08092001");
- GuestLecture t2=new GuestLecture("hey","hello","atl","suresh",100,"08092001");
- GuestLecture t[]=new GuestLecture[2];
- t[0]=t1;
- t[1]=t2;
- show(t,2);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment