Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

newbie question: Extends and implements

Thread view: 
Jacky Luk - 22 Nov 2005 09:04 GMT
I have been programming with VC++ for many years. Now I would like to extend
my knowledge to Java. I'd like to know what "Extends" and "Implements"
keywords in the class declaration do... Thanks in advance
Jack
Luc The Perverse - 22 Nov 2005 10:03 GMT
>I have been programming with VC++ for many years. Now I would like to
>extend my knowledge to Java. I'd like to know what "Extends" and
>"Implements" keywords in the class declaration do... Thanks in advance
> Jack

Extends is just standard class inheritance.

Implements is similar, but only abstract functions can be derived (no
attributes.)

This question seems to be jumping into the middle, however.  I suggest you
get a Java book and start from the beginning.  If you all ready know how to
program, you should be able to go very quickly through any tutorial or book.

--
LTP

:)
Jacky Luk - 22 Nov 2005 10:46 GMT
Thank you so much
Jack

"Luc The Perverse" <sll_noSpamlicious_z_XXX_m@cc.usu.edu> ¼¶¼g©ó¶l¥ó·s»D:4382ecda$0$8246$3a2ecee9@news.csolutions.net...
>>I have been programming with VC++ for many years. Now I would like to
>>extend my knowledge to Java. I'd like to know what "Extends" and
[quoted text clipped - 15 lines]
>
> :)
Roedy Green - 22 Nov 2005 13:34 GMT
>I have been programming with VC++ for many years. Now I would like to extend
>my knowledge to Java. I'd like to know what "Extends" and "Implements"
>keywords in the class declaration do... Thanks in advance
see http://mindprod.com/gettingstarted.html

You will need a text book for that.  Read a text first before posting
any more questions, or you will find people refusing to answer you
later when you ask questions not in every elementary textbook.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Bhupendra - 23 Nov 2005 12:12 GMT
extends:-
in java extends keyword is used for inheritence from only one class

example

public class demo extends Frame   \\\legal declaration
{  ......... }

public class demo extends Frame, Applet   \\\illegal declaration
{  ......... }

implementation Keyword: -

The implements keyword is used for multiple inheritence in java, but
you can only implement only interface (which same as like abstract
classes in C++ but only difference is here that no methods  should have
body in interface.

example:

inteface demoInterface1
{
 public void demoMethod(int demoVar);
}

inteface demoInterface2
{
 public void demoMethod(int demoVar);
}

public class demo extends Frame implements demoInterface1,
demoInterface2
{.................................}

Here you are extending Frame class and implementing multiple interface
demoInteface1, demoInteface2 but the methods body of the the interface
methods will be written in class where the inteface has been
implemented.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.