Skip to main content

developerWorks >  Java technology  >  Forums  >  Java theory and practice forum  >  developerWorks

How can abstract methods return types and values?    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
Permlink Replies: 5 - Pages: 1 - Last Post: Oct 6, 2009 2:36 AM Last Post By: blackchan Threads: [ Previous | Next ]
akw.

Posts: 3
Registered: Sep 29, 2009 07:14:15 AM
How can abstract methods return types and values?
Posted: Sep 29, 2009 07:24:23 AM
Click to report abuse...   Click to reply to this thread Reply
How can abstract methods return types and values?
m_muhammadali

Posts: 10
Registered: Aug 30, 2009 01:35:34 PM
Re: How can abstract methods return types and values?
Posted: Oct 02, 2009 03:46:06 AM   in response to: akw. in response to: akw.'s post
Click to report abuse...   Click to reply to this thread Reply
An abstract method is the one which is declared without an implementation.If a class includes abstract methods, the class itself called abstract class. When a class extends abstract class, the subclass usually provides implementations for all of those abstract methods which can return values.
akw.

Posts: 3
Registered: Sep 29, 2009 07:14:15 AM
Re: How can abstract methods return types and values?
Posted: Oct 04, 2009 09:16:03 AM   in response to: m_muhammadali in response to: m_muhammadali's post
Click to report abuse...   Click to reply to this thread Reply
Yes, So how is it that the java standard library has abstract methods that return types and values? wtf?

How could such a design flaw exist in such a tightly controlled development platform?

So the question still stands, how is it possible to return types and values with abstract methods?
blackchan

Posts: 3
Registered: Oct 05, 2009 12:45:37 AM
Re: How can abstract methods return types and values?
Posted: Oct 05, 2009 12:55:18 AM   in response to: akw. in response to: akw.'s post
Click to report abuse...   Click to reply to this thread Reply
you don't understand the concept and usage of abstract method and abstract class. It's is quite normal for declaring a abstract method with a return type. it is not a design flaw.
akw.

Posts: 3
Registered: Sep 29, 2009 07:14:15 AM
Re: How can abstract methods return types and values?
Posted: Oct 05, 2009 12:15:16 PM   in response to: blackchan in response to: blackchan's post
Click to report abuse...   Click to reply to this thread Reply
Declaring a return type or value is totally different then actually returning a type or value like some abstract methods do. So if I dont understand the concept and usage of abstract methods, then explain to me why abstract methods in java.nio.channels.Selector actually return values and types and not just declare the return type or value.
blackchan

Posts: 3
Registered: Oct 05, 2009 12:45:37 AM
Re: How can abstract methods return types and values?
Posted: Oct 06, 2009 02:36:50 AM   in response to: akw. in response to: akw.'s post
Click to report abuse...   Click to reply to this thread Reply
java.nio.channels.Selector is an abstract class itself,which can not be instantiated by calling it's protected constructor 'new Selector()'. so, you cann't even get an instance of the abstract class java.nio.channels.Selector, how can you managed to make a call to it's abstract methods and get return values from it's abstract methods?
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums