what is difference between Interface and abstract class
Answers were Sorted based on User's Feedback
Answer / naveen
Interface is a specification it tells a class has what to do.
It is purely abstract class it contains abstract methods and final static variables.
Generally begining of the project PM or TL are providing the Interfaces, developers are implementing the Interfaces.
Abstract class
Abstract class is a mediator between Interface and Class , any common code is their that code written in Abstract class and then extend the Abstract class. Abstract class containing abstract and concreate methods.
Abstract class are used in Designing level.If take java predifined class we understand easily.
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / surender kannuri
interface is a specification of method prototype.
all methods in interface are abstract and final.
interface methods are public since they should be available
to third party vendor to provide implementation.they are
abstract because their implementation is left for third
party vendors.
interface contains 0 or more abstract methods.
all methods of interface should implemented in implemented
class.if any method is not implemented then implementation
class should be declared as abstract.
we can't create object to interface.but we can create
reference to interface type.
an interface contains variables ,such as public.static and
final variables.this means all variables of interface are
constant.
an interface cannot implements another interface.
an interface can extend another interface.
it is possible to write a class within an interface.
a class can implements(not extend) multiple interfaces.
abstract class contains 0 or more abstract methods.
all methods of abstract class should be implemented in
subclasses only.
all methods of abstract class should be declared by using
abstract keyword.
we can't create an object to abstract class.
| Is This Answer Correct ? | 1 Yes | 1 No |
i need to know the website that i can compile and run a java code in online.(while system doesn't contain any jdk and jre)
Write a java program to find the route that connects between Red and Green Cells. General Rules for traversal 1. You can traverse from one cell to another vertically, horizontally or diagonally. 2. You cannot traverse through Black cells. 3. There should be only one Red and Green cell and at least one of each should be present. Otherwise the array is invalid. 4. You cannot revisit a cell that you have already traversed. 5. The maze need not be in the same as given in the above example
when a servlet sends request for first time it uses the follwing methods a)init b)doget() c)dopost() d)service
Which class is the superclass for every class in java programming?
What are abstract classes and anonymous classes?
0 Answers Flextronics, Thomson Reuters, Virtusa,
What do you mean by platform independence?
how can you retrive information from database by using hashmap/arraylist ,plz explain with example briefly?
Explain try and catch keywords in java?
What is defined as false sharing in the context of multithreading?
If there is no implementation of MARKER INTERFACE in java. Then how compiler come to know about specification.
What will happens if you opened Internet Explorer 4 times?
What is externalizable?