易截截图软件、单文件、免安装、纯绿色、仅160KB

Java Native Method[还没来得及翻译]

The goal for this chapter is to introduce you to Java's native methods. If you are new to Java, you may not know what native methods are, and even if you are an experienced Java developer, you may not have had a reason to learn more about native methods. At the conclusion of this chapter you should have a better understanding of what native methods are, when and why you may want to use them, and the consequences of using them. You should also have a basic understanding of how native methods work. You will then be more than ready to tackle the next three chapters, which dive into the nitty-gritty details of Java's Native Methods.
What Is a Native Method?
Simply put, a native method is the Java interface to non-Java code. It is Java's link to the "outside world." More specifically, a native method is a Java method whose implementation is provided by non-Java code, most likely C (see Figure 30.1). This feature is not special to Java. Most languages provide some mechanism to call routines written in another language. In C++, you must use the extern "C" stmt to signal that the C++ compiler is making a call to C functions. It is common to see the qualifier pascal in many C compilers to signal that the calling convention should be done in a Pascal convention, rather than a C convention. FORTRAN and Pascal have similar facilities, as do most other languages.
Figure 30.1 : A native method is a Java method whose implementation is provided by non-java code.
In Java, this is done via native methods. In your Java class, you mark the methods you wish to implement outside of Java with the native method modifier-much like you would use the public or static modifiers. Then, rather than supplying the method's body, you simply place a semicolon in its place. As an example, the following class defines a variety of native methods:
public class IHaveNatives
{
native public void Native1( int x ) ;
native static public long Native2() ;
native synchronized private float Nativ


相关文档:

【转载】Java/Hibernate/标准SQL 数据类型对应表


Java数据类型
Hibernate数据类型
标准SQL数据类型
(PS:对于不同的DB可能有所差异)
byte、java.lang.Byte
byte
TINYINT
short、java.lang.Short
short
SMALLINT
int、java.lang.Integer
integer
INGEGER
long、java.lang.Long
long
BIGINT
float、java.lang.Float
float
FLOAT
double、java.lang.Doubl ......

传智播客java培训 java基础之JSP异常处理

炎热的天气依旧持续,掐指算来,到北京刚好两月了,每天都投入到充实的学习中,
感觉良好,不过昨天上课竟然睡觉,而且晚上还看了电影。。。。。要保持警惕,放松
但是不能太放松!!!!
培训的时间毕竟很短,错过了这几个月,以后估计就很少能静下心来学习了,要珍惜,
要努力,GOGO!!
JSP异常处理方式:
  第 ......

Java解惑2 23不劳无获

下面的程序将打印一个单词,其第一个字母是由一个随机数生成器来选择的。请描述该程序的行为:
import java.util.Random;
public class Rhymes {
private static Random rnd = new Random();
public static void main(String[] args) {
StringBuffer word = null;
switch(rnd.nextInt(2)) {
......

Java解惑3 26在循环中

下面的程序计算了一个循环的迭代次数,并且在该循环终止时将这个计数值打印了出来。那么,它打印的是什么呢?
public class InTheLoop {
public static final int END = Integer.MAX_VALUE;
public static final int START = END - 100;
public static void main(String[] args) {
int count = 0 ......

java 容器类 小结 troy

JAVA的容器---List,Map,Set
Collection
├List
│├LinkedList
│├ArrayList
│└Vector
│ └Stack
└Set
Map
├Hashtable
├HashMap
└WeakHashMap
Collection接口
  Collection是最基本的集合接口,一个Collection代表一组Object,即Collection的元素(Elements)。一些 Collection允许相 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号