Results 1 to 5 of 5
- 10-22-2009, 11:03 PM #1
Member
- Join Date
- Oct 2009
- Posts
- 16
- Rep Power
- 0
- 10-22-2009, 11:37 PM #2
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
hey if you dont mind can you specify your error or a part where you want help with ? that would be great
mext time do add code tags :)
- 10-23-2009, 12:02 AM #3
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
ok here
Write a PersonAbstract class that has one abstract method: ToString
this states to make the to string method abstract so you dont need to implement the method
; is enoughabstract String toString()
But in the other Person class where you extend the abstract class
There you need to implement the toString method. this is called overRiding.
- 10-23-2009, 12:06 AM #4
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
as for the Part B when you extend . you overrite the to String method of the person class.
by declaring the method signature and body where you channge the "tenure" part of the
method as stated in the problem description.
its the same in part c but you need to check for the other "Field"
- 10-23-2009, 12:55 AM #5
Senior Member
- Join Date
- Oct 2009
- Location
- California,US
- Posts
- 201
- Rep Power
- 4
no
here
and in Teacher & Studend ClassJava Code:[CODE]abstract class PersonAbstract { public String toString(); }
I do overriding like this ?
[/CODE]Java Code:public String toString() { String message = "Name: " + name + "\n" + "Age: " + age + "\n" + "Tenure: " + tenure + "\n" ; return message; }
Similar Threads
-
Help me to solve problem
By mansoorhacker in forum Forum GuidesReplies: 8Last Post: 01-24-2009, 06:29 PM -
Help me to solve problem
By mansoorhacker in forum New To JavaReplies: 3Last Post: 11-13-2008, 08:15 AM -
Can any one solve this?I want full code.
By sreenathuuu in forum New To JavaReplies: 3Last Post: 08-20-2008, 08:45 AM -
Creating and checking directories with java code
By tim in forum New To JavaReplies: 8Last Post: 01-07-2008, 05:41 AM -
java code for checking if a software is installed or not
By heggemony in forum Advanced JavaReplies: 1Last Post: 07-31-2007, 01:19 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks