Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class Main

java.lang.Object
    |
    +----Main

public class Main
extends java.lang.Object
Provides a main() method for running the shared stubs example. Shared stubs allow you to call native code (such as the standard C library's printf function) from Java code, with very little work.

This class uses our prototype implementation of the shared stubs distributed with this example.

Author:
Sheng Liang
See Also:
CFunc, CPtr, CMalloc

Constructor Summary
 Main()
 
 

Method Summary
static void  main(java.lang.String[] main_args)
Demonstrates calling printf, scanf, etc from the C library using shared stubs.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
Method Detail

main

public static void main(java.lang.String[] main_args)
Demonstrates calling printf, scanf, etc from the C library using shared stubs.

Note that this is an example demonstrating the use of shared stubs, and must not be construed as us encouraging the use of printf from Java code! Infact, we strongly discourage you from doing so --- the Java platform APIs provide powerful, type-safe and portable alternatives for these C functions, and the Java versions will be a performance win. We hope that shared stubs will be useful to you if you absolutely must write native methods.

Output from C's printf is enclosed in <>, to distinguish it from things we print with System.out.println.

Parameters:
main_args - Arguments passed from the command line. Currently unused.

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS