• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

Java question regarding abstract method implementation

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
Sreejith22
Asked:
Sreejith22
  • 3
  • 2
3 Solutions
 
objectsCommented:
The implementation would be in a subclass of the abstract class
0
 
objectsCommented:
though you shouldn't generally need to see the implementation

http://download.oracle.com/javase/tutorial/java/IandI/abstract.html
0
 
Sreejith22Author Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
msk_apkCommented:
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
 
Sreejith22Author Commented:
Thanks objects!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now