Can a similar functionality be achieved in Java?
function sum(num1, num2, onComplete)
{
var result = num1 + num2;
onComplete(result);
}
(function(){
sum(3, 5, function(res){alert(res)});
})()
Is it possible to implement this in Java without worrying about the specific version?