File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Function pointer support in Java 7?

 
Krish Ghata
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

I heard that in java 7 we have function pointer support like c++. how we will do it in java
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krish Ghata wrote:Hi Michael,

I heard that in java 7 we have function pointer support like c++. how we will do it in java


I dont think so there is function pointer support in Java 7. And if you are talking about Method References then its part of Project Lambda for Java 8
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krish,

You might be referring to MethodHandles (and MethodTypes)? In that case you can certainly use them with Java 7. If you mean some sort of Java syntax that emits an invokedynamic byte code instruction, then no, that will come with Lambdas in Java 8. In the mean time, enthusiasts use the ASM 4.0 library.
 
Krish Ghata
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martijn,

thanks for your reply. yes i am actually looking for invoke dynamic byte code instruction, as c++ guys can do just passing a reference of function(method in case of java) as a parameter.
i will try this ASM 4.0 library, it will be very helpful if you able to provide some reference or examples.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Krish, the best thing to do is go through the tutorial
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic