Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > newbie question: Extends and implements

Reply
Thread Tools

newbie question: Extends and implements

 
 
Jacky Luk
Guest
Posts: n/a
 
      11-22-2005
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


 
Reply With Quote
 
 
 
 
Luc The Perverse
Guest
Posts: n/a
 
      11-22-2005
"Jacky Luk" <(E-Mail Removed)> wrote in message news:4382df17$1@127.0.0.1...
>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




 
Reply With Quote
 
 
 
 
Jacky Luk
Guest
Posts: n/a
 
      11-22-2005
Thank you so much
Jack

"Luc The Perverse" <(E-Mail Removed)> glsD:4382ecda$0$8246$(E-Mail Removed) tions.net...
> "Jacky Luk" <(E-Mail Removed)> wrote in message news:4382df17$1@127.0.0.1...
>>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
>
>
>



 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      11-22-2005
On Tue, 22 Nov 2005 17:04:24 +0800, "Jacky Luk" <(E-Mail Removed)> wrote,
quoted or indirectly quoted someone who said :

>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.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Reply With Quote
 
Bhupendra
Guest
Posts: n/a
 
      11-23-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with implements and extends su_dang@hotmail.com Java 2 02-16-2007 08:58 PM
Cant a class extends a abstract class and implements a interface at once?? moxosyuri@gmail.com Java 8 09-27-2006 12:47 AM
How to create a java "extends"/"implements" clause with xsd file and castor? Stacey XML 0 01-20-2004 01:52 PM
Implements and Interface Jordan Smith Java 3 11-28-2003 02:14 PM
Samba 3 extends lead over Win 2003....newbie or wannabe mcse's - get a clue! DaveT MCSE 8 11-05-2003 08:54 PM



Advertisments