Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Java Master Java Interface

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

33 comments so far (post your own) View All Comments Latest 10 Comments:

Any normal class can be abstract no necessary to have at least one abstract Method.All the method may be defined,all may be undefined or both can be as well as.

Posted by Bhagat Bishnoi on Thursday, 09.23.10 @ 18:42pm | #99817

Dear Sir, in your comparison table column one you have written that Abstract class must have at least one abstract method which does not hold true exactly, an abstract class can be abstract even if it does not have single abstract method.
Regards
Sachin

Posted by Sachin Tomar on Thursday, 09.23.10 @ 17:30pm | #99813

An abstract is not obliged to have at least an abstract method as has been stated above. A class can be an abstract class without having any abstract method. However, if we define an abstract method then the class has to be an abstract class

Posted by Manas on Wednesday, 09.15.10 @ 20:58pm | #99609

HI

Can i get more details about Marker Interface

Posted by meena on Thursday, 08.26.10 @ 18:37pm | #99180

please give the real time example for interface in java?

Posted by saranya on Tuesday, 07.13.10 @ 18:34pm | #98163

It is a good explanation for marker interface. Thanks!

Posted by Velu on Friday, 06.11.10 @ 21:09pm | #97526

Hi,
Basically we need understand why to opt an Interface or an Abstract Class.

Interface is basically a standard or acts as a plugin. If any class implements an inteface then all the methods present in the interface has to be defined in that class. It is a commitment by the class which is implementing this interface to define all the methods present in the interface.

Where as an Abstract class is required when the class needs to inherit or extend some behaviour of the Abstract class to be present with it. To be more clear about this, we opt abstract classes when we should fit into the class hierarchy.

Posted by anu on Friday, 05.14.10 @ 11:23am | #97023

An abstract class must have at least one method with empty implementation.

Posted by Ananya on Thursday, 04.15.10 @ 02:13am | #96379

this is awesome really nice to understand

Posted by maruthamkumar on Tuesday, 01.12.10 @ 09:09am | #93965

In the above statements "An abstract class must have at least one method with empty implementation."but this is a wrong statement even if it doesn't have atleast one method with empty implementaion we can declare a class as an abstract.I checked this one
Thank you

Posted by Anoop on Monday, 12.21.09 @ 23:51pm | #93554

NO you cant do this. If you have this type of requirement then u have to use EXternizable interface and implement its writerExternal and readExternal method urself.

Posted by Nitin on Wednesday, 11.4.09 @ 16:51pm | #92328

Compiler will give any error. See the following code:-
import java.io.*;
public class OT
{
public static void main(String j[]) throws Exception
{
TT t = new TT();
ObjectOutputStream oos = new ObjectOutputStream(System.out);
oos.writeObject(t);
}
}
class TT{}

Here compiler does not if TT class implemented Serializable or not. Runtime Exception will be there if u try to run this program.

Posted by Nitin on Wednesday, 11.4.09 @ 16:49pm | #92327

send me complete details on java to my id

Posted by muner on Thursday, 09.24.09 @ 21:25pm | #91183

Can you tell me difference between equals and == in Strings.And intern method With a good example.

Posted by Ashish Yadav on Friday, 03.13.09 @ 12:31pm | #85818

ur meterial is well ang good for learing java

Posted by srinivasarao on Tuesday, 01.6.09 @ 02:33am | #83509

Hi,
Can i get a more detailed information for difference between Interface and abstract classes . Specially for point 4 with some coding example.
Thanks,
Jayant Singh

Posted by Jayant Singh on Monday, 12.15.08 @ 06:02am | #82779

U R PROVIDDING VERY GOOD CONCEPT SUCH AS BLIND MAN EASILY STUDY HE CAN UNDERSTAND

Posted by sushil swain on Friday, 11.28.08 @ 02:38am | #82134

When should we use abstract class?Why should we use abstract class?
when should we use interface instead of abstract class?

Posted by Gopinath on Monday, 11.24.08 @ 21:25pm | #81988

I want to know the use of interface. we are declaring the methods inside the interface and defining the methods in the program. we can do the same without the interface also. then whats the use of the interface?

Posted by sneha on Tuesday, 10.28.08 @ 11:13am | #81363

I Find it Better Website for java.

Posted by Muhammed Hussain on Wednesday, 10.22.08 @ 15:18pm | #81242

Explain how run-time polymorphism can be achieved using interfaces with sample program?

Posted by kinjal on Tuesday, 09.23.08 @ 17:00pm | #80634

In package with out inheritance(extends) how we use seperate class and how we access in main class.

Posted by vinothini.E on Friday, 09.5.08 @ 18:39pm | #77263

pleese sent me java nots and programs file

Posted by pravin on Saturday, 08.30.08 @ 04:56am | #76005

JAVA CONCEPTS NOT CLEAR

Posted by AMIT on Tuesday, 08.26.08 @ 17:09pm | #75264

we can`t create object for interface.. because all methods are abstract. but in abstract class we are instantiating object ... how it is??

Posted by vinoth on Saturday, 08.16.08 @ 14:31pm | #73087

what is the use of inheritance AND WHEN TO USE THIS?
what i understood is while using inheritance we can reuse the code. please provide me more informaton regarding this

Posted by ramaraju on Thursday, 08.14.08 @ 08:22am | #72761

i am having doubt regarding util packages. and i want to know what is the difference between arraylist, vector and hash map , hashtable and iterator, list iterator, enumerators. where we will use and when to use this

Posted by ramaraju on Thursday, 08.14.08 @ 08:18am | #72760

i want to known the use of interface with example

Posted by rama raju on Tuesday, 08.12.08 @ 01:15am | #72351

what java is pure oop.

Posted by mohd daoud on Friday, 08.8.08 @ 12:46pm | #71764

Hi... plz give me brief intro of interface in java.. with an example ..how to implements it... i will be thank full .....thanks.........

Posted by puneet on Friday, 07.11.08 @ 10:16am | #66658

i want to different between method overloading and method overriding? 3 to 4 differences giv me plzz send me my mail naveenk_raju@yahoo.co.in

Posted by naveen on Friday, 04.25.08 @ 17:47pm | #57852

i want to know, like if a subclass of a class implementing Serilizable interface, don't want to be serialize, so how can we prevent this Serialization....

Posted by Vishal on Wednesday, 02.20.08 @ 01:18am | #49130

I want to know the use of interface. we are declaring the methods inside the interface and defining the methods in the program. we can do the same without the interface also. then whats the use of the interface. Please send me about interface in detail..

Posted by Joseph on Tuesday, 06.12.07 @ 12:09pm | #18976

Ask programming questions?

 

 

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.