?
Solved

Java question regarding abstract method implementation

Posted on 2011-03-20
6
Medium Priority
?
503 Views
Last Modified: 2012-06-21
Hi experts,

I was referring some open source java code of android. In one of the classes, I saw a method call to another class. The method called was an abstract method inside an abstract class. As is expected, the abstract method do not have any implementation. But, to my wonder, this abstract method returns a List. I do not know, without having any implementation(and return statement) for a method, how this method returns a List?

Please refer the code attached.

Any help in this regard would be appreciated.

Best Regards,
Sreejith
// Calling Method

final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);

//Called Method inside another abstract class

public abstract List<ResolveInfo> queryIntentActivities(Intent intent,
            int flags);

Open in new window

0
Comment
Question by:Sreejith22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 1000 total points
ID: 35178480
The implementation would be in a subclass of the abstract class
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 35178482
though you shouldn't generally need to see the implementation

http://download.oracle.com/javase/tutorial/java/IandI/abstract.html
0
 

Author Comment

by:Sreejith22
ID: 35179350
Hi Objects,

Thanks for your reply. I found out the sub class  of this abstract class which has this method. When I provided a log inside this method, I found out that, this method is being called 5 times, while I was just expecting a single call.

Is there any method by which, I can identify the class(or method), from which this method is called, by providing a log inside called method?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 35179407
0
 
LVL 4

Expert Comment

by:msk_apk
ID: 35180092
when you call ,

final List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);

manager must be pointing to the object in which the method queryIntentActivities is implemented.
0
 

Author Closing Comment

by:Sreejith22
ID: 35204462
Thanks objects!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days software publishers make it possible to move all the possible applications on smartphones, tablets, smartwatches, and more. Although behind every logic and decision is a gross doubt: how do they make it possible? In this blog post, we sha…
If you use the Google Now Launcher, as an aftermarket add on, have a Samsung Note 5 and are worried about power consumption be wary of using the ultra power saving mode.  Here is what happened to me when I made the mistake of trying this out...
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question