interface - how to bring abstraction in java application..logic for abstraction in project -


i know abstract classes , interfaces in java want know how bring abstraction in working software/project? how thing in such way brings abstraction.

your question vague @ best, usage of interfaces helps abstraction because not working concrete types. instance:

iprinter p = printerfactory.getprinter(conditions); ... p.print(content); 

in below line, not aware of what printer using. since using logic, not care. care factory give printer after , print method print content right stream.

if want change printer being used, make amendments in factory class different iprinter implementation need (which in case print other media). mean have changed outcome of piece of code without changing of it.


Comments

Popular posts from this blog

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

php - facebook and github login HWIOAuthBundle and FOSUserBundle in Symfony2.1 -

hadoop - Sqoop installation export and import from postgresql -