Why does Java not support function/method pointers/references ala C/C++?

John Mitchell

Because Java is a more pure object-oriented language than C/C++. Function pointers and method references are ways of pulling apart the functionality of objects.

The Java, OO way of doing the equivalent is pass around an object reference where that object adheres to a particular interface and so you can invoke the appropriate methods.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact