My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Passing a class as an argument - Java API

Ethan Manzi's photo
Ethan Manzi
·Feb 16, 2018

I'm creating an API in Java for some of my projects, and I have one main problem. I need to allow for a call-back in it. The API is a web server API, which handles cookies, FS, Sockets, and even my own language ( I couldn't get PHP to work ), so now all I need to do, is when the server is asked to resolve content, the user should be asked what they want to do. I know some APIs can do this, where you define functions ( or whatever they're called ), and implement/extend the API class, and then the API can call those classes, but I can't figure out how to do that.