1. what is the difference between Abstract and Interface Classes? 2. when do u use Abstract and when do we go for Interface in programming? 3. what is the difference between JSP and Servlets? 4. when we can do everything in JSP that we can do in Servlets, then why do we go for servlets in our programming and tell me in what situations we will go for Servlets? 5. give me five major differences between HTML and XML? thank you for answering my questions in advance. with regards Suresh
>>1. what is the difference between Abstract and Interface Classes? abstract classes cannot be instantiated (you cannot call their constructor/no objects of that class may be made). And in an inheritance hierarchy the subclasses that extend the abstract class MUST implement the abstract methods of that parent class, or be declared as abstract themselves. Interfaces have no strict hierarchy involved in the sense that anyone can implement an interface, there is no inheritance assumied.
>>2. when do u use Abstract and when do we go for Interface in programming? it is really up to your descetion. i personally have found myself using abstract classes more than interfaces, but that is purely because of the projects i have worked on. if you were to create a dog and cat class for instance, good practice would be to say what dogs and cats have in common: they eat, they have coloured hair, they have eyes whatever.. so an animal class could be created abstract, and have abstract methods such as 'hasEaten()'. by hasEaten() being abstract, we are insisting that any classes extending that abstract class must implement that method. (UNLESS it too is abstract.) >>3. what is the difference between JSP and Servlets? not really relevant to this board, please see http://www.coderanch.com/t/354569/Servlets/java/Servlets-vs-JSP >>4. when we can do everything in JSP that we can do in Servlets, then why do we go for servlets in our programming and tell me in what situations we will go for Servlets? again, please re-ask or search at: http://www.coderanch.com/forums/f-7/Servlets
5. give me five major differences between HTML and XML? a basic understanding is that xml and html are very similar in the sense of having open and close comments. and they look very similar. HTML (hyper text markup language) however, has a defined dictionary if you will, where specific tags have specific purposes. i.e. <table> <td > is a defined tag with the purpose of creating a table. xml has the same basic concept of these open/close tags, but is undefined in the sense that <you> </you> will/can differ depending on who is using it. There are companies who have alligned to define xml tags in the context of their business. (an example is Sun, Microsoft and IBM) And the advantage here is really essential, where if such tags were not standardised there would be issues regarding definition of system data. And also obviousy their uses vary, depending on their purpose. http://www.dnjonline.com/articles/essentials/iss13_essentials_xml.html hope this helps -twans