Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
1) Abstract and native cannot be applied together as abstract means its implementations is provided in the subclass(that is no implementaion is provided and next implementing class has to provide) but in case of native ,we mean that implementation is already provided just use it.So there is no meaning in specifying both together.
2)As I said native implementation is already provided ,you can use private modifier to it.
But can any one tell me how the JAVA API calls the native methods and will be implemented them.?
i am some what confusing about native methods , how java can implement these methods internally?
It's just a different call stack. Normally, methods are compiled to byte codes and it is part of a class. Native methods are different in that they are not directly part of the class -- instead the JVM looks for them, in libraries, which has been loaded eariler.
To write your own native methods, you simply run your java class file (with the native methods specified) through the javah program. This will generate you a C/C++ include file -- which declares the interface for you to code the method in C/C++.
You then compile your function into a share library -- and likely go back to the original class to add a static initializer to load that library.
Henry [ November 27, 2007: Message edited by: Henry Wong ]