-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest73.java
40 lines (38 loc) · 858 Bytes
/
Test73.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.lang.* ;
class Emp
{
int eno;
String ename;
double esal;
char egrade;
Emp(int eno,String ename,double esal,char egrade)
{
this.eno=eno;
this.ename=ename;
this.esal=esal;
this.egrade=egrade;
}
}
class Dept extends Emp
{
int deptno;
String deptname;
Dept(int eno,String ename,double esal,char egrade,int deptno,String deptname)
{
super(eno,ename,esal,egrade);
this.deptno=deptno;
this.deptname=deptname;
}
void dispVals()
{
System.out.println("Eno="+eno+"\t"+"Ename"+ename+"\t"+"Esal="+esal+"Egrade="+egrade+"\t"+"Deptno="+deptno+"\t"+"Deptname="+deptname);
}
}
class Main
{
public static void main(String args[])
{
Dept D=new Dept(101,"Anil",45567.75,'A',1,"Manager");
D.dispVals();
}
}