hi, i am new to java programming!! i was working with extended inheritance and found that i had some problem with passing parameters using superand get and set methods..
my program has three classes. student,person and a main class. i am trying to extend the person class to student and add some employee ID which is unique to student. i have a toString method in person class which prints out first and last name of the person. further, i am overriding this method with another tostring() in student. the problem is when i try to print out the student info using s.toString() in main method i am getting this output.. ----------------- student info first namenull Last name:null student ID23 --------------------- whereas when i try to print out just the person info it prints out the names right.. could somebody put a sample code to demonstrate the same scenario.. thanks
thanks... i made some mistake in the way i was passing the parameters..i got it right now. i can't put my code here since this is an assignment and i may be held for plagiarism..thats the reason why i didn't post my code..i will try to explain my problem better next time. thanks