| Author |
Polymorphic Arguments
|
Niyas Ahmed Sheikh
Ranch Hand
Joined: Jun 15, 2005
Posts: 129
|
|
Hi, I have tried the below sample coding to know how the polymorphic arguments are working. By the above coding, I'm not getting any error. But the below codings, raise the error. Just I have included the System.out.println statement to know the flow of thr pgm. Any other advise/desc/hidden facts about the polymorphic arguments are WELCOME!
|
 |
Niyas Ahmed Sheikh
Ranch Hand
Joined: Jun 15, 2005
Posts: 129
|
|
Sorry..forget to give the error message And here we go!!!
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Originally posted by Niyas Ahmed Sheikh: Just I have included the System.out.println statement to know the flow of thr pgm.
You can't have statements like that. The statements should be present inside a method, or a constructor or a static block... For example, you should change your Manager class as
|
Mani
Quaerendo Invenietis
|
 |
Steve Simon Joseph Fernandez
Ranch Hand
Joined: Jul 17, 2005
Posts: 35
|
|
Hi, Executable statements (in this case, System.out.println()) have to be placed inside a method. Put your println's inside the class constructor. _steve.
|
 |
 |
|
|
subject: Polymorphic Arguments
|
|
|