import java.io.*;
class
employee
{
private
String empname;
private int
empcode;
void
read(String s,int p)
{
empname= s;
empcode=p;
}
void
display()
{
System.out.println("The
employee name is :" +empname);
System.out.println("The
employee code is :"+empcode);
}
}
class
labourer extends employee
{ private
String labourtype;
private
int laboursalary;
void
read1()throws IOException
{
BufferedReader br= new BufferedReader( new InputStreamReader (System.in));
System.out.println("Enter
the employee name:");
String a=br.readLine();
System.out.println("Enter
the employee code :");
int
p= Integer.parseInt(br.readLine());
read(a,p);
System.out.println("Enter
the labourtype :");
labourtype = br.readLine();
System.out.println("Enter
the labour salary :");
laboursalary=Integer.parseInt(br.readLine());
}
void
display1()
{
display();
System.out.println(" The
labour type is : "+ labourtype);
System.out.println(" The
labour salary is :"+laboursalary);
}
}
class single
{ public
static void main (String s[])throws
IOException
{BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter
the number of employees");
int n = Integer.parseInt(br.readLine());
labourer
l[]= new labourer[n];
for(int i=0; i<n; i++)
l[i]=
new labourer();
for(int i=0; i<n; i++)
l[i]
.read1();
for(int i=0; i<n; i++)
l[i].display1();
}
}
Output
|
Nice & Informative Blog !
ReplyDeleteIn case you are searching for the best technical services for QuickBooks, call us at QuickBooks Error 15106 1-855-977-7463 and get impeccable technical services for QuickBooks. We make use of the best knowledge for solving your QuickBooks issues.
Nice & Informative Blog !
ReplyDeleteGiven the recent outbreak of COVID 19, we at QuickBooks Customer Service Number don't just work hard but also help you get rid of the issue in less time.
Your VT Markets Account Allows You To Login To Your Account In More Than 1 Country.
ReplyDeleteHey! What a wonderful blog. I loved your blog. QuickBooks is the best accounting software; however, it has lots of bugs like QuickBooks for MAC Support . To fix such issues, you can contact experts via QuickBooks Support Phone Number (855)963-5959.
ReplyDeleteTrade Capital Options: Mobile Forex Trading Offers Customers The Opportunity To Trade A Wide Array Of Assets And Financial Instruments With A 30p Per Lot Commission.
ReplyDeleteI’m really happy to say it was an interesting post to read. I learned new information from your article on amity solved synopsis
ReplyDelete, you are doing a great job
steroid satın al
ReplyDeleteheets
NTXX
With a nationwide presence, Active Detailing transforms every vehicle into a work of automotive art, leaving an indelible mark of excellence.
ReplyDelete