File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Features new in Java 7 and the fly likes Function pointer support in Java 7? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 7
Reply Bookmark "Function pointer support in Java 7?" Watch "Function pointer support in Java 7?" New topic
Author

Function pointer support in Java 7?

Krish Ghata
Greenhorn

Joined: Sep 27, 2011
Posts: 3
Hi Michael,

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

Joined: Sep 08, 2007
Posts: 2925
    
  15

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


Mohamed Sanaulla | My Blog
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3268

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.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Krish Ghata
Greenhorn

Joined: Sep 27, 2011
Posts: 3
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

Joined: Jun 24, 2003
Posts: 3268

Hi Krish, the best thing to do is go through the tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Function pointer support in Java 7?
 
Similar Threads
CallBack methods
Linked List
Function Pointer
Anyone have any experience with JNIWrapper?
Function pointers