Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro Java
|
Pro Java Expert level Java questions not about a specific book. Please indicate your version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Java 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 September 11th, 2006, 04:53 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default when does extends and interfaces behave the same

hi a question was asked for an interview. i could not make it out but the question was:

when does the "extends" and "interfaces" keywords behave the same(or simillar manner)

Thanks for the help
 
Old September 11th, 2006, 06:33 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I would suggest that your interviewer didn't really know either.

when you implement an interface, you have to create a completely working class, which implements all of the required methods declared in the interface.

When you extend a class, you are inheriting all of the public behaviour of that class, and you can override any specific elements you want to customize, but any functionality you do not add will revert to the superclass.

 
Old September 11th, 2006, 07:04 AM
Authorized User
 
Join Date: May 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i guess so but he was telling something about generics






Similar Threads
Thread Thread Starter Forum Replies Last Post
interfaces malli_kv2 Java Basics 1 April 23rd, 2007 05:21 AM
Instantiating Interfaces simsdagr8 C# 2005 4 November 30th, 2006 07:37 AM
Polymorphism with Interfaces digby_dog VB.NET 2002/2003 Basics 2 May 11th, 2005 12:50 PM
extends memory of jvm zhebincong J2EE 0 April 18th, 2005 02:10 AM
POST method behave strangely laxenai Beginning PHP 1 May 4th, 2004 12:23 PM





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