package javaapplication14;
class employee
{
double salary;
}
class developer extends employee
{
int dvbonus=5000;
String dv_name;
}
class designer extends employee
{
int debonus=4000;
String de_name;
}
public class JavaApplication14 {
public static void main(String[] args)
{
designer de=new designer();
double salary= de.salary=35000;
String name= de.de_name="ali";
System.out.println("Name="+name+"\ntotal salary= "+(salary+de.debonus));
developer d=new developer();
salary=d.salary=50000;
name="immad";
System.out.println("Name="+name+"\ntotal salary= "+(salary+d.dvbonus));
}
}
No comments:
Post a Comment