JVM中的常见约定
Language is just like a puppet.
在类签名中 “()V” 是什么意思?
The JVM uses a compact way of storing method signatures, of which constructors are considered a special case.
For your example:
() indicates a method taking no arguments
V indicates that it returns nothing
The other parts of the scheme are:
B - byte
C - char
D - double
F - float
I - int
J - long
S - short
V - void
Z - boolean
[ - array of the thing following the bracket
L [class name] ; - instance of this class, with dots becoming slashes
( [args] ) [return type] - method signature
For example:
public int foo(String bar, long[][] baz)
would become
(Ljava/lang/String;[[J)I
See the spec at Sun^H^H^HOracle's web site
union用法示例
#include<stdio.h>
union var{
long int l;
int i;
};
main(){
union var v;
v.l = 5;
printf("v.l is %d\n",v.i);
v.i = 6;
printf("now v.l is %ld! the address is %p\n",v.l,&v.l);
printf("now v.i is %d! the address is %p\n",v.i,&v.;
}
结果:v.l is 5now v.l is 6! the address is 0xbfad1e2c