Java 变量类型与 native 变量类型 java 类型 native 类型描述对应的 C 类型 booleanjbooleanunsigned 8 bitsunsigned char bytejbytesigned 8 bitschar jcharunsigned 16 bitsunsigned.

Slides:



Advertisements
Similar presentations
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
第六章 数组与字符串 §6.1 数组 §6.2 字符串. §6.1 数组 数组的创建 ( 一维数组和二维数组;基本数据类型和 复合数据类型) 1. 指定数组名称、数据类型 type var_name[]; 如: char s[]; Object o[]; int i[][];
Software Engineering Implementation Lecture 3 ASPI8-4 Anders P. Ravn, Feb 2004.
1 Class Vehicle #include #define N 10../.. 2 Class Vehicle class vehicle { public: float speed; char colour[N+1]; char make[N+1];
第十二章 常微分方程 返回. 一、主要内容 基本概念 一阶方程 类 型 1. 直接积分法 2. 可分离变量 3. 齐次方程 4. 可化为齐次 方程 5. 全微分方程 6. 线性方程 类 型 1. 直接积分法 2. 可分离变量 3. 齐次方程 4. 可化为齐次 方程 5. 全微分方程 6. 线性方程.
Writing Native Code for Android Systems. Why ndk (native developers kit) There exist large c/c++ code libraries – E.g., Audio and video compression, e.g.,
退 出退 出退 出退 出 上一页 下一页 仪器使用 §1-2 尺规绘图工具和仪器的使用方法 图板丁字尺三角板 比例尺圆规分规铅笔曲线板。 要提高绘图的准确度和绘图效率,必须正确地使用各种绘图工 具和仪器。常用的手工绘图工具和仪器有图板、丁字尺、三角板、 比例尺、圆规、分规、铅笔、曲线板等。 提示:将光标放在仪器上,
Block Turbo Decoder Design Hu Dongwei. Error Correcting Codes Classic Block Codes BCH RS RM Convolutional Codes (Viterbi) Turbo Codes Parallel Concatenated.
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit
More Specifically JNI Justin Catterson.  ADA  C++  Java  Ruby  Python  Haskell  Perl  etc. What is a Foreign Function Interface? Simply an interface.
第 12 章位运算 C 语言兼具高级语言及低级语言的特性,因此 适合编写系统软件。 C 语言具备低级语言的特性 就在于它能直接对硬件进行操作,即位运算。 所谓位运算是指,按二进制位进行的运算。 例如,将一个存储单元中各二进位左移或右移一 位等。
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
DCN 多核防火墙快速配置之 目的 NAT 配置 神州数码网络 蒋忠平.
Primitives in Java Java has eight primitive types –boolean –integral types: signed: long, int, short, byte unsigned: char –floating point types: double,
Writing Native Code for Android Systems. Why ndk There exist large c++ code libraries – E.g., Audio and video compression, e.g., Ogg Vorbis, The LAME.
C语言程序设计 第十三章 文件.
1 为了更好的揭示随机现象的规律性并 利用数学工具描述其规律, 有必要引入随 机变量来描述随机试验的不同结果 例 电话总机某段时间内接到的电话次数, 可用一个变量 X 来描述 例 检测一件产品可能出现的两个结果, 也可以用一个变量来描述 第五章 随机变量及其分布函数.
BASIC JAVA. Hello World n // Hello world program public class MyFirstJavaProgram { public static void main(String args[]) { char c = 'H'; String s =
第三章 C 数据及其表达式 2 回顾  程序是为执行一项任务而编写的有序指令集  算法是解决问题的具体方法和步骤  流程图是算法的图形化表现形式  C 程序的编译和运行过程  编译器将源程序转换成机器能理解的程序  连接器用于连接相关的目标文件以生成可执行程序  进制间的转换  补码.
第 4 章 过程与变量的作用范围. 4.1 Visual Basic 的代码模块 Visual Basic 的应用程序是由过程组成的, 过程代码存放在模块中。 Visual Basic 提供了 三类模块,它们是窗体模块、标准模块和类 模块。 窗体模块 窗体模块是大多数 Visual Basic.
语义分析 主要内容:  语义分析概述 ( 必要性、功能、描述方法 )  符号表  类型表达式  声明和程序体的语义分析.
流态化 概述 一、固体流态化:颗粒物料与流动的流体接触,使颗粒物料呈类 似于流体的状态。 二、流态化技术的应用:流化催化裂化、吸附、干燥、冷凝等。 三、流态化技术的优点:连续化操作;温度均匀,易调节和维持; 气、固间传质、传热速率高等。 四、本章基本内容: 1. 流态化基本概念 2. 流体力学特性 3.
白 雪 飞 中国科学技术大学电子科学与技术系 Dept. of Elec. Sci. & Tech., USTC Fall, 2007 第 8 章 结 构 体.
第一节 相图基本知识 1 三元相图的主要特点 (1)是立体图形,主要由曲面构成; (2)可发生四相平衡转变; (3)一、二、三相区为一空间。
第 3 章 控制流分析 内容概述 – 定义一个函数式编程语言,变量可以指称函数 – 以 dynamic dispatch problem 为例(作为参数的 函数被调用时,究竟执行的是哪个函数) – 规范该控制流分析问题,定义什么是可接受的控 制流分析 – 定义可接受分析在语义模型上的可靠性 – 讨论分析算法.
编译原理总结. 基本概念  编译器 、解释器  编译过程 、各过程的功能  编译器在程序执行过程中的作用  编译器的实现途径.
Java 程序设计 Java Programming Fall, Contents for Today Java Program Structure  How to Compile a Java Program  How to Run a Java Program Environment.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
What is Android NDK ● A toolset that lets you embed in you app native source code ● C, C++(recently supported December 2010) and assembly(?) ● It is supported.
《 UML 分析与设计》 交互概述图 授课人:唐一韬. 知 识 图 谱知 识 图 谱知 识 图 谱知 识 图 谱.
《过程控制工程》课程组. 化学反应器概述 化学反应器是生产过程的重要设备之一,化学反应状态很大程度决定产 品的质量,产量。因此反应器的操作最优化具有实际意义。  反应器分类 ( 1 )物料进出状态:间歇式,连续式 ( 2 )物料流程分:单程、循环 ( 3 )反应器结构:釜式、管道式、塔式、固定床、流化床.
Rutgers University Excellence Campaign 2/20/2004 Java Native Interface Tutorial Xiaolin Li Rutgers.
Java Introduction to JNI Prepared by Humaira Siddiqui.
Chapter Two– Data Numbering & Character Encoding System in Microcomputer Principles of Microcomputers 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日 2015年10月22日.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
1 Primitive Data Types and Operations C/C++ Language Programming Wanxiang Che.
Android JNI and JAR Library JNI Library 1. JNI *.c sources file must include jni header file jni.h #include 2. In Make file CFLAGS must add -I $(NDK_INC)/
项目七: PLC 功能指令应用 带进位循环左移指令 XXXXX. 项目七: PLC 功能指令应用 FX2 系列可编程控制器移位控制指令有移位、循环移位、字移位 及先进先出 FIFO 指令等 10 条指令。 带进位循环右移指令 RCR 带进位循环左移指令 RCL 字右移位指令 WSFR 先入先出读出指令.
Ruby on Rails -- a short intro Tao Zhang. Outline Part 1: sth. about script language Part 2: sth. about RoR.
是什么? 有什么用? 机要文件科研成果商业机密 原创设计 重要资料,有时难免被泄露或被剽窃。
1 Hu Junfeng 2015/09/23 第三讲 语言 数据类型 流程控制 函数. 关于选课和免修.
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
SMIE-121 Software Design II School of Mobile Information Engineering, Sun Yat-sen University Lecture.
演示场景. 类图 配置 HibernateApplicationContext.xml hibernate.cfg.xml 创建数据库 – ooad/ooad 关于 Library/Project 模板.
Java 程序设计 Java 程序设计 Java Programming Spring, 2013.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
逻辑设计基础 1 第 7 章 多级与(或)非门电路 逻辑设计基础 多级门电路.
Chapter 2 Java Basic. Outline 1. Defining of Classes 2. Constructors( 构造器 ) 3. The"this"Keyword 4. The"static"Keyword 5. Lifetimes of Variables (变量的生存期)
Data Types Always data types will decide which type of information we are storing into variables In C programming language we are having 3 types of basic.
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1.
Java Scanner Class Keyboard Class. User Interaction So far when we created a program there was no human interaction Our programs just simply showed one.
Generation of Chinese Character Based on Human Vision and Prior Knowledge of Calligraphy 报告人: 史操 作者: 史操、肖建国、贾文华、许灿辉 单位: 北京大学计算机科学技术研究所 NLP & CC 2012: 基于人类视觉和书法先验知识的汉字自动生成.
Caffe学习 骆石英 2016/01/25.
@ 淘宝丁奇 MySQL 与锁. 讲师介绍 讲师简介: 丁奇: 08 年至 10 年在百度贴吧,作服务端开发,开始接触 MySQL 。 之后由于业务需要开始看 MySQL 代码,囫囵吞枣不求甚解。 10 年得机会进入淘宝核心系统数据库组,主要是 MySQL 优化和提 升可维护性。参与 IC 、 TC.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
JNI Introduction Getting Started Type, String, Array Field(struct), Method Exception.
生化实验的数字化 D igital I nformation S ystem Laboratory —— 数字化信息系统在生物化学实验中的应用.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
FUNDAMENTALS OF JAVA.
Unit-2 Objects and Classes
null, true, and false are also reserved.
Introduction to Java Programming
An overview of Java, Data types and variables
JavaScript Reserved Words
Default Arguments.
Java Programming Review 1
Event and Time yw sun, hao zhang.
Agenda Types and identifiers Practice Assignment Keywords in Java
Presentation transcript:

java 变量类型与 native 变量类型 java 类型 native 类型描述对应的 C 类型 booleanjbooleanunsigned 8 bitsunsigned char bytejbytesigned 8 bitschar jcharunsigned 16 bitsunsigned short shortjshortsigned 16 bitsshort intjintsigned 32 bitsint longjlongsigned 64 bits long(64) long long (32) floatjfloatsigned 32bitfloat doublejdoublesigned 64 bitsdouble

示例:基本数据类型参数 [java 代码 : Test.java] package com.mz.jni; public class Test { private native void show ( boolean a1, byte a2, short a3, int a4, long a5, float a6, double a7, char a8 );

JNIEXPORT void JNICALL Java_com_mz_jni_Test_show(JNIEnv * env, jobject thiz, jboolean a1, jbyte a2, jshort a3, jint a4, jlong a5, jfloat a6, jdouble a7, jchar a8) { int c_a1 = a1; char c_a2 = a2; short c_a3 = a3; int c_a4 = a4; long long c_a5 = a5; float c_a6 = a6; double c_a7 = a7; unsigned short c_a8 = a8; LOGI("c_a1=%d\n", c_a1);//c_a1=0 LOGI("c_a2=%d\n", c_a2);//c_a2=2 LOGI("c_a3=%d\n", c_a3);//c_a3=33 LOGI("c_a4=%d\n", c_a4);//c_a4=44 LOGI("c_a5=%lld\n", c_a5);//c_a5= LOGI("c_a6=%f\n", c_a6);//c_a6= LOGI("c_a7=%lf\n", c_a7);//c_a7= //a8 接收汉字会有乱码 LOGI("c_a8=%d\n", c_a8);//c_a8=65 LOGI("c_a8=%c\n", c_a8);//c_a8=A }