How do I call the method in the sub-class in java? -



How do I call the method in the sub-class in java? -

i have sub classes , 1 base. base of operations movie, , phone call method in fiction method sub-class. method called other method called (management.java). fiction has own field called typeofmovie , getter , setter method. i'm trying is, phone call getter or setter method. if create like:

movie m = new fiction();

i cannot phone call getter or setter method there. way should create abstract method in movie class? could, number of fields getting bigger, thought base of operations class might messy.

is way can do?

also, field bundle private (default), still cannot access way either can give me advice please?

thanks

your declaration say's m of type film , can phone call methods declared in film ( if of base of operations class methods overridden in subclass, overridden method code executed ). if want phone call methods in subclass .you have create object

fiction f = new fiction();

java

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -