Abstract Class and Interface
When we have got is the interface then do you need is an abstract class? ....since i can divide an abstract class to two one is interface and the other a concrete class.....So where is the exact functionality of an abstract class.
Why is that a file name should be the same as that of the public class declared in that file?
[344 byte] By [
njay] at [2007-9-30 9:04:59]

<< When we have got is the interface then do you need is an abstract class?>>
no
Interfaces are used when you want to provide no implementation, abstract classes when you want to provide some implementation but not all and because the are missing implementation you can't create them. Using both of these usually implies that you will create subclasses that have different implementations. The other option for the parent is a regular class that has a full implementation. All or a combination of the 3 can be appropriate depending on the situation.
<<Why is that a file name should be the same as that of the public class declared in that file?>>
No particular reason except that is the way the creators of Java decided it should be
Steve -
http://www.jamonapi.com - a fast, open source performance tuning API
http://www.fdsapi.com - An open source tool that makes creation of dynamic text from tabular data easy (arrays, ResultSets,...)
[url=http://mindprod.com/jgloss/interfacevsabstract.html]Java Glossary : interface vs abstract class[/url]
[url=http://www.javaworld.com/javaworld/javaqa/2001-04/03-qa-0420-abstract.html]Abstract classes vs. interfaces: When does it make sense to choose an abstract class over an interface?[/url]
[url=http://www.javaworld.com/javaworld/javaqa/2001-08/03-qa-0831-interface.html]Abstract classes and interfaces practicum: Move from theory to practice on when to employ abstract classes vs. interfaces[/url]
[url=http://java.sun.com/developer/JDCTechTips/2001/tt1106.html#tip2]Tech Tips: ABSTRACT CLASSES VS. INTERFACES[/url]