www.delorie.com/gnu/docs/gcc/gcj_39.html   search  
 
Buy the book!


Guide to GNU gcj

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.9.2 Static methods

Static Java methods are invoked in CNI using the standard C++ syntax, using the :: operator rather than the . operator.

For example:

 
jint i = java::lang::Math::round((jfloat) 2.3);

C++ method definition syntax is used to define a static native method. For example:

 
#include <java/lang/Integer>
java::lang::Integer*
java::lang::Integer::getInteger(jstring str)
{
  ...
}


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003