Forum : run time errror in inheritance,
Brief description  about Online courses   join in Online courses
View yasho mithra S 's Profile

run time errror in inheritance,

sir,i have tried to execute a simple program but could not as it is showing run time error,please provide me a simple short program on inheritance which i can run and see what is the actual problem in my program,
Asked by yasho mithra S | Feb 22, 2011 |  Reply now
Replies (3)
View arun kumar das 's Profile
Hi,

try with this code, if you are still facing problem to run it than let me know.

class person1
{
int age;
String qualification;
void assign()
{
age=25;
qualification="B.Tech";
}
void output()
{
System.out.println("age of the engineer is"+age);
System.out.println("qualification of the engineer is "+qualification);
}
}

class SoftwareEngineer extends person1
{

}
class engineer
{
public static void main(String[]args)
{
SoftwareEngineer se=new SoftwareEngineer();
se.assign();
se.output();
}
}

Feb 24, 2011
View yasho mithra s 's Profile
class person1
{
int age;
String qualification;


void assign()
{
age=25;
qualification="B.Tech";
}

void output()
{
System.out.println("age of the engineer is"+age);
System.out.println("qualification of the engineer is "+qualification);
}

}

class SoftwareEngineer extends person{
}



class engineer


{
public static void main(String[]args)
{
SoftwareEngineer se=new SoftwareEngineer();
se.output();
}
}
Feb 22, 2011
View arun kumar das 's Profile
HI

Can you send me program in which you are getting problem, just copy and past in Discussion board, i will give the correct solution.

java teacher
Feb 22, 2011