SlideShare a Scribd company logo
1.
Importjava.util.*;
Classemployee
{
Stringaddr,name,phno;
Intage;
Floatsalary;
Voidread()
{
Scannersc = newScanner(System.in);
System.out.println(“Enterthe name of the employee”);
Name = sc.nextLine();
System.out.println(“Enterthe address”);
Addr= sc.nextLine();
System.out.println(“Enterthe phone number”);
Phno= sc.nextLine();
System.out.println(“Enterthe age”);
Age = sc.nextInt();
System.out.println(“Enterthe salaryof the employee”);
Salary= sc.nextFloat();
}
VoidprintSalary()
{
System.out.println(“Salary=”+salary);
}
}
Classofficerextendsemployee
{
Stringspec,dept;
Voidinput()
{
Scannersc = newScanner(System.in);
System.out.
Println(“Enterthe specializationof the officer”);
Spec= sc.nextLine ();
}
Voiddisplay()
{
System.out.println(super.name+“t” + super.age +“t” + super.phno+
“t” + super.addr+ “t” + spec );
}
}
Classmanagerextendsemployee
{
Stringspec,dept;
Voidinput()
{
Scannersc = newScanner(System.in);
System.out.println(“Enterthe departmentof the managerer”);
Dept= sc.nextLine ();
}
Voiddisplay()
{
System.out.println(super.name+“t” + super.age +“t” + super.phno+
“t” + super.addr+ “t” + dept);
}
}
ClassMain
{
Publicstaticvoidmain(Stringargs[])
{
Officero= newofficer();
o.read();
o.input();
managerm = newmanager();
m.read();
m.input();
o.display();
o.printSalary();
m.display();
m.printSalary();
}
}
2.
Importjava.util.*;
Classemployee
{
Voiddisplay()
{
System.out.println (“SALARY”);
}
Voidcalcsalary()
{
System.out.println(“The salaryof the employee is40000”);
}
}
Classengineerextendsemployee
{
Voidsalary()
{
System.out.println(“The salaryof the engineeris50000”);
}
}
ClassMain
{
Publicstaticvoidmain(Stringargs[])
{
Engineere = newengineer();
e.display();
e.calcsalary();
e.salary();
}
}

More Related Content

TXT
Empolyee deatils in java
DOCX
Java Programs
PPTX
Java programs
PDF
Hashing enderecamento aberto bean - bean
DOC
5 Rmi Print
PDF
Linux Awk cheat sheet and examples infographics
PPTX
Durable Functions
PDF
for this particular program how do i create the input innotepad 1st ?#include...
Empolyee deatils in java
Java Programs
Java programs
Hashing enderecamento aberto bean - bean
5 Rmi Print
Linux Awk cheat sheet and examples infographics
Durable Functions
for this particular program how do i create the input innotepad 1st ?#include...

What's hot (15)

PDF
for this particular program how do i create the input innotepad 1st ? #includ...
PPT
Backdoor coding
PDF
merged_document_3
DOCX
WAP to find out whether the number is prime or not in java
PDF
オレオレSecurityバンドル作っちゃいました
PPTX
From clever code to better code
PDF
Open Telecomunication Platform (OTP)
PPTX
The secret unit testing tools no one ever told you about
DOCX
Linked list imp of list
TXT
Auto increment number
PPTX
Unit testing patterns for concurrent code
PDF
Asynchronen Code testen
DOCX
applet.docx
PDF
Twigエクステンションの作り方
PDF
Java 스터디 강의자료 - 1차시
for this particular program how do i create the input innotepad 1st ? #includ...
Backdoor coding
merged_document_3
WAP to find out whether the number is prime or not in java
オレオレSecurityバンドル作っちゃいました
From clever code to better code
Open Telecomunication Platform (OTP)
The secret unit testing tools no one ever told you about
Linked list imp of list
Auto increment number
Unit testing patterns for concurrent code
Asynchronen Code testen
applet.docx
Twigエクステンションの作り方
Java 스터디 강의자료 - 1차시
Ad

Similar to Java (20)

PDF
define a class name Employee whose objects are records for employee..pdf
DOCX
Lab8.classpathLab8.project Lab8 .docx
PDF
First compile all the classes.But to run the program we have to run .pdf
DOCX
2. Create a Java class called EmployeeMain within the same project Pr.docx
PDF
Hi, I need help with a java programming project. specifically practi.pdf
DOCX
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
PDF
Tasks In this assignment you are required to design and imp.pdf
PDF
Program for Constructor Overloading and Inheritance.pdf
PDF
Code Include libraries. import javax.swing.JOptionPane;.pdf
PDF
Part 1 Implement a superclass Employee that has the following field.pdf
PDF
You will need to develop a system that can track employee informatio.pdf
PDF
package employeeType.employee;public abstract class Employee {  .pdf
PDF
Implementation Your program shall contain at least the follo.pdf
PDF
java programming languageThe attached A12.txt file which has 2 col.pdf
PDF
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
DOCX
All Of My Java Codes With A Sample Output.docx
DOCX
Main Java[All of the Base Concepts}.docx
DOCX
computer project code ''payroll'' (based on datafile handling)
PDF
public class Person { private String name; private int age;.pdf
PDF
package employeeType.employee;public class Employee {    private.pdf
define a class name Employee whose objects are records for employee..pdf
Lab8.classpathLab8.project Lab8 .docx
First compile all the classes.But to run the program we have to run .pdf
2. Create a Java class called EmployeeMain within the same project Pr.docx
Hi, I need help with a java programming project. specifically practi.pdf
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
Tasks In this assignment you are required to design and imp.pdf
Program for Constructor Overloading and Inheritance.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdf
Part 1 Implement a superclass Employee that has the following field.pdf
You will need to develop a system that can track employee informatio.pdf
package employeeType.employee;public abstract class Employee {  .pdf
Implementation Your program shall contain at least the follo.pdf
java programming languageThe attached A12.txt file which has 2 col.pdf
VTU Design and Analysis of Algorithms(DAA) Lab Manual by Nithin, VVCE, Mysuru...
All Of My Java Codes With A Sample Output.docx
Main Java[All of the Base Concepts}.docx
computer project code ''payroll'' (based on datafile handling)
public class Person { private String name; private int age;.pdf
package employeeType.employee;public class Employee {    private.pdf
Ad

Recently uploaded (20)

PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
L1 - Introduction to python Backend.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Transform Your Business with a Software ERP System
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
L1 - Introduction to python Backend.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
Upgrade and Innovation Strategies for SAP ERP Customers
Odoo POS Development Services by CandidRoot Solutions
Wondershare Filmora 15 Crack With Activation Key [2025
Operating system designcfffgfgggggggvggggggggg
Transform Your Business with a Software ERP System
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Internet Downloader Manager (IDM) Crack 6.42 Build 41
wealthsignaloriginal-com-DS-text-... (1).pdf
How Creative Agencies Leverage Project Management Software.pdf
CHAPTER 2 - PM Management and IT Context
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

Java