Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2009, 11:51 PM
Authorized User
 
Join Date: Sep 2008
Posts: 87
Thanks: 1
Thanked 0 Times in 0 Posts
Default basic java

Hi,

whats the difference between interface and a complete abstract class(no variables declared).
other than the way of using multiple inheritance do we have any other difference between this two.

when do we go for both ...
 
Old February 11th, 2009, 04:32 AM
jomet
Guest
 
Posts: n/a
Default

Abstract class can have methods that implement a default behavior.
An interface has all public members and no implementation.


 
Old April 11th, 2009, 01:44 AM
Friend of Wrox
 
Join Date: Dec 2008
Posts: 238
Thanks: 2
Thanked 20 Times in 19 Posts
Default

If an interface also comes with a default abstract implementation, when you extend, you only need to implement the methods that are truly needed in your situation, and leave the rest alone - this simplifies your code.

SAX deafult event handler is a good example.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Cause:java.lang.NoSuchMethodError: java.util. anees81 JSP Basics 3 March 1st, 2011 08:55 AM
java.lang.OutOfMemoryError: Java heap space meetkotresh J2EE 1 February 2nd, 2008 01:52 AM
Java Code - Wrox - Beginning JAVA - Ivor Horton ponguru Java Databases 3 May 18th, 2006 12:30 PM
Visual Basic to Java shinning Java Basics 0 January 8th, 2006 03:15 AM
Java vs Java Script functions joemorrison74 J2EE 0 July 6th, 2005 04:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.