OOP with Java 通知 Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 学习使用文本编辑器 学习使用 cmd: Power shell 阅读参考资料
|
|
- 析 莘
- 5 years ago
- Views:
Transcription
1 OOP with Java Yuanbin Wu
2 OOP with Java 通知 Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 @ecnu.cn 学习使用文本编辑器 学习使用 cmd: Power shell 阅读参考资料
3 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
4 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
5 Java 类型 Java 类型 基本类型 (primitive types) 频繁使用 类 (class) 自定义 数组 (array)
6 Java 类型 复习 : 类型与对象 属于同一个类型的对象 每个人的手机, 手机 房间中不同的灯泡, 灯泡 int a = 1; 类型是对象将提供的服务的描述 面向对象编程的基本步骤 定义类型 创建属于该类型的对象 ( 实例化 ) 使用对象的服务
7 Java 类型 Java 类型 基本数据类型 (primitive types) 类 (class) 数组 (array)
8 Java 基本类型 1. 跨平台 2. unsigned
9 Java 基本类型 定义类型 创建对象 int a = 1, double d = 1.0; 使用对象 int b = a * 2;
10 Java 基本类型 boolean 布尔型 仅取两个值 : true, false 逻辑表达式 C: 非零即为真 if (1), if(2), if(-1) Java If(1), if(2), if(-1) if(true)
11 Java 基本类型 char C: 实际为整数 signed char: 有符号, 至少包含 [-127, 127] unsigned char: 无符号, 至少包含 [0, 255] Java: 16bit
12 Java 基本类型 基本类型的封装 (Wrapper) int: 基本类型 Integer: 类 提供更多与整数相关的功能
13 Java 基本类型 More on Java char (16 bit) ASCII Unicode 新的字符编码方式, 目前已使用超过 120,000 个 ( 是否能用 16bit 存储?) Utf-8: 一种 Unicode 的变长实现方式, 以 8bit 为单位增长, 与 ASCII 兼容 Utf-16: 一种 Unicode 的变长实现方式, 一个或两个 16bit. 前 16bit 能代表常用的 Unicode (basic multilingual plane) char: 16 位 仅能表示 Unicode 中的 basic multilingual plane char array, String Utf-16 字符数组 字符对象组成的数组 每个 unicode code point 可能有两个 16 bit ( 称为 unicode code unit).
14 Java 类型 Java 类型 基本类型 (primitive types) 类 (class) 数组 (array)
15 Java 类 定义 Java 类 class MyType { int i; double d; char c; void set(double x); double get(); } 数据 (Fields) 方法 (Methods)
16 Java 类 创建类的对象 malloc 构造函数 MyType a = new MyType(); 访问数据成员, 使用对象的方法 Let's try int b = a.i; a.set(); a.get();
17 Java 类 C 语言 struct typedef typedef MyType MyType; struct MyType { int i; double d; char c; void set(double x); double get(); } MyType m; m.i = 1; m.d = 1.0; m.c = 'a'; MyType* n = (MyType*) malloc(sizeof(mytype)); n->i = 1; n->d = 1.0; n ->c = 'a'; free(n);
18 Java 类 创建类的对象 使用对象的方法? 销毁对象 Java 自动销毁 MyType a = new MyType(); int b = a.i; a.set(); a.get();
19 Java 类 对比基本类型与类 基本类型 : int 类 : Integer String
20 Java 类 数据成员默认初始值 Primitive type Default boolean char byte short false '\u0000' (null) (byte)0 (short)0 int 0 long 0L float 0.0f double 0.0d
21 Java 类型 Java 类型 基本类型 (primitive types) 类 (class) 数组 (array)
22 数组 顺序存储对象 数组类型 int a[ ]; int [ ]a; MyType m[ ]; MyType [ ]m; 不指定长度
23 数组 初始化 静态初始化 int [ ]a = {1, 2, 3, 4, 5};
24 数组 初始化 动态初始化 1 int [ ]a = new int[5]; MyType [ ]m = new MyType[3];
25 数组 初始化 动态初始化 2 int [ ]a = new int[5] {1, 2, 3, 4, 5}; MyType [ ]a = new MyType[3] { new MyType(), new MyType(), new MyType() };
26 数组 数组元素的默认值 基本类型 默认值 类 Null Let's try
27 数组 二维数组 定义 int a[ ][ ]; Int [ ][ ]a; MyType m[ ][ ]; MyType [ ][ ]m;
28 数组 二维数组 静态初始化 int [ ][ ] a= { {1,2,3}, {4, 5, 6} };
29 数组 二维数组 动态初始化 1 int [ ][ ] a= new int[2][3]; MyType [ ][ ] m= new MyType[2][2];
30 数组 二维数组 动态初始化 2 int [ ][ ]a = new int[2][3]{ {1,2,3}, {4,5,6} }; MyType [ ][ ]m = new MyType[2][2]{ {new MyType(), new MyType()}, {new MyType(), new MyType()} }
31 数组 多维数组 int [ ][ ][ ] a= new int [2][3][3]; MyType [ ][ ][ ] m = new int[6][6][6];
32 数组 不规则数组 (ragged array) int [ ][ ] a= { {1, 2}, {3, 4, 5}, {7, 8, 9, 10}};
33 数组 数组 数组可以视为一个 类 数据成员 : length 数组的长度 (Let's try) int [ ][ ] a= { {1, 2}, {3, 4, 5}, {7, 8, 9, 10}}; int i = a.length; 方法成员 : [i] a[i] 返回数组的第 i 个元素
34 总结 Java 类型 基本类型 类 Int, char, float, double, boolean, long, short class MyType {int I; double d; double get(); } 数组
35 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
36 引用 以下程序的运行结果? int [ ] a = new int[3]{1,2,3}; int [ ] b; b = a; b[0] = 4; System.out.println(a[0]);
37 引用 引用 (Reference, 类型的引用 ) 对象的名字 同一个对象可以有不同的名字 创建一个应用 引用间赋值 创建对象返回对象的引用 int [ ] a = new int[3]{1,2,3}; int [ ] b; b = a; b[0] = 4; System.out.println(a[0]);
38 引用 引用 (Reference) MyType m = new MyType(); MyType n; n = m; n.set(1.0); System.out.println(m.get());
39 引用 指针? Java int [ ] a = new int[3]{1,2,3}; int [ ] b; b = a; b[0] = 4; System.out.println(a[0]); C int *a = (int *)malloc(sizeof(int) * 3); a[0] = 1;a[1] = 2; a[2] = 3; int *b = a; b[0] = 4; printf( %d\n, a[0]);
40 引用 Java 标准并没有指定引用应该如何实现 绝大多数 Java 内部使用指针实现引用 创建一个引用指针 引用间赋值指针 创建对象返回对象的引用指针 int [ ] a = new int[3]{1,2,3}; int [ ] b; b = a; b[0] = 4; System.out.println(a[0]);
41 引用 引用与指针的关系 引用是受限的指针 引用 不允许指针运算 : int a[] = {1, 2, 3}; a++; 不能强制转换 类的引用, 数组的引用 基本类型的引用 int a = 1; a 为普通变量, 并非 ' 指针 '
42 引用 引用的初始化 MyType m = new MyType(); MyType m = null; 默认初始化 类定义中的引用被默认初始化为 null Class A { MyType m; } 数组中元素的引用被默认初始化为 null MyType [ ]m = new MyType[3]; for (int i= 0; i < 3; ++i) System.out.println(m[i]);
43 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
44 不可变类型 不可变类型 (immutable) 类型的对象一旦创建就不能被改变 例子 String 类, Integer 类, Float 类... String s = Hello World ; System.out.println(s.toUpperCase()); System.out.println(s); 可变类型 (mutable) 例子 MyType, 数组 MyType m = new MyType(); System.out.println(s.get()); m.set(1.0); System.out.println(s.get()); int []a = {1, 2, 3}; System.out.println(a[0]); a[0] = 1 System.out.println(a[0]);
45 不可变类型 不可变类型的优点 简单 易用 安全
46 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
47 对象存储位置 对象在内存中的位置 C 语言 void func() { int x = 0;... } void func() { int *ptr = (int*)malloc(sizeof(int));... } 栈内存 ( 局部变量 ): 1. 自动分配 / 销毁 2. 由编译器完成 3. 又称 自动内存 堆内存 : 由程序员负责分配 / 销毁 当函数返回时?
48 对象存储位置 对象在内存中的位置 Code Heap Free FFFFFFFF Stack
49 对象存储位置 Java 基本类型 栈内存 类 堆内存 new malloc 不用显式回收 Java 虚拟机自动回收无效的内存 垃圾回收 (Garbage Collection)
50 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域
51 作用域 作用域 大括号 : { } int x = 12; { int q = 96; } { } String s = 1234 ;
52 总结 Java 类型 基本类型, 类, 数组 引用 受限的指针 不可变类型 一旦创建对象则不能改变 对象存储位置 栈, 堆 作用域 { }
OOP with Java 通知 Project 2 提交时间 : 3 月 21 日晚 9 点 作业提交格式 学习使用 文本编辑器 cmd, PowerShell (Windows), terminal(linux, Mac)
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 2 提交时间 : 3 月 21 日晚 9 点 作业提交格式 学习使用 文本编辑器 cmd, PowerShell (Windows), terminal(linux, Mac) 复习 面向对象编程 将实际问题分解成不同的对象 不的对象提供不同的服务 对象之间可以传递消息 例子小李深夜
More informationOOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 18 日晚 9 点 关于抄袭 没有分数 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double
More informationOOP with Java 通知 Project 4: 5 月 2 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 5 月 2 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d =
More informationOOP with Java 通知 Project 4: 4 月 19 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 复习 类的复用 组合 (composition): has-a 关系 class MyType { public int i; public double d; public char c; public void set(double x) { d
More informationOOP with Java 通知 : Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 : Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 Email: 51141201063@ecnu.cn 复习 : Java 类型 基本类型 boolean, char, 封装 (wrappers) 类 (class) 定义 class MyType { int i;
More informationOOP with Java 通知 : Project 2 提交时间 : 3 月 15 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 : Project 2 提交时间 : 3 月 15 日晚 9 点 复习 : Java 类型 基本类型 boolean, char, 封装 (wrappers) 类 (class) 定义 class MyType { int i; double d; 数据 (Fields) char c; void set(double
More informationCC213
: (Ken-Yi Lee), E-mail: feis.tw@gmail.com 49 [P.51] C/C++ [P.52] [P.53] [P.55] (int) [P.57] (float/double) [P.58] printf scanf [P.59] [P.61] ( / ) [P.62] (char) [P.65] : +-*/% [P.67] : = [P.68] : ,
More informationOOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 3 提交时间 3 月 29 日晚 9 点 Piazza Project 2 投票 复习 创建对象 构造函数 函数重载 : 函数 = 函数名 + 参数列表 public class MyType { int i; double d; char c; void set(double x)
More information3.1 num = 3 ch = 'C' 2
Java 1 3.1 num = 3 ch = 'C' 2 final 3.1 final : final final double PI=3.1415926; 3 3.2 4 int 3.2 (long int) (int) (short int) (byte) short sum; // sum 5 3.2 Java int long num=32967359818l; C:\java\app3_2.java:6:
More information新・解きながら学ぶJava
481! 41, 74!= 40, 270 " 4 % 23, 25 %% 121 %c 425 %d 121 %o 121 %x 121 & 199 && 48 ' 81, 425 ( ) 14, 17 ( ) 128 ( ) 183 * 23 */ 3, 390 ++ 79 ++ 80 += 93 + 22 + 23 + 279 + 14 + 124 + 7, 148, 16 -- 79 --
More information1 Project New Project 1 2 Windows 1 3 N C test Windows uv2 KEIL uvision2 1 2 New Project Ateml AT89C AT89C51 3 KEIL Demo C C File
51 C 51 51 C C C C C C * 2003-3-30 pnzwzw@163.com C C C C KEIL uvision2 MCS51 PLM C VC++ 51 KEIL51 KEIL51 KEIL51 KEIL 2K DEMO C KEIL KEIL51 P 1 1 1 1-1 - 1 Project New Project 1 2 Windows 1 3 N C test
More informationC 1
C homepage: xpzhangme 2018 5 30 C 1 C min(x, y) double C // min c # include # include double min ( double x, double y); int main ( int argc, char * argv []) { double x, y; if( argc!=
More informationOOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 3: 3 月 29 日晚 9 点 4 月 1 日上课 复习 Java 包 创建包 : package 语句, 包结构与目录结构一致 使用包 : import restaurant/ - people/ - Cook.class - Waiter.class - tools/ - Fork.class
More informationOOP with Java 通知 Project 4: 4 月 19 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 4 月 19 日晚 9 点 复习 Protected 可以被子类 / 同一包中的类访问, 不能被其他类访问 弱化的 private 同时赋予 package access class MyType { public int i; public double d; public char
More information新版 明解C++入門編
511!... 43, 85!=... 42 "... 118 " "... 337 " "... 8, 290 #... 71 #... 413 #define... 128, 236, 413 #endif... 412 #ifndef... 412 #if... 412 #include... 6, 337 #undef... 413 %... 23, 27 %=... 97 &... 243,
More informationC/C++程序设计 - 字符串与格式化输入/输出
C/C++ / Table of contents 1. 2. 3. 4. 1 i # include # include // density of human body : 1. 04 e3 kg / m ^3 # define DENSITY 1. 04 e3 int main ( void ) { float weight, volume ; int
More information51 C 51 isp 10 C PCB C C C C KEIL
http://wwwispdowncom 51 C " + + " 51 AT89S51 In-System-Programming ISP 10 io 244 CPLD ATMEL PIC CPLD/FPGA ARM9 ISP http://wwwispdowncom/showoneproductasp?productid=15 51 C C C C C ispdown http://wwwispdowncom
More informationint *p int a 0x00C7 0x00C7 0x00C int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++;
Memory & Pointer trio@seu.edu.cn 2.1 2.1.1 1 int *p int a 0x00C7 0x00C7 0x00C7 2.1.2 2 int I[2], *pi = &I[0]; pi++; char C[2], *pc = &C[0]; pc++; float F[2], *pf = &F[0]; pf++; 2.1.3 1. 2. 3. 3 int A,
More informationC++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 5 月 3 日 1
C++ 程序设计 告别 OJ1 - 参考答案 MASTER 2019 年 月 3 日 1 1 INPUTOUTPUT 1 InputOutput 题目描述 用 cin 输入你的姓名 ( 没有空格 ) 和年龄 ( 整数 ), 并用 cout 输出 输入输出符合以下范例 输入 master 999 输出 I am master, 999 years old. 注意 "," 后面有一个空格,"." 结束,
More information无类继承.key
无类继承 JavaScript 面向对象的根基 周爱 民 / aimingoo aiming@gmail.com https://aimingoo.github.io https://github.com/aimingoo rand = new Person("Rand McKinnon",... https://docs.oracle.com/cd/e19957-01/816-6408-10/object.htm#1193255
More informationOOP with Java 通知 Project 4: 推迟至 4 月 25 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 推迟至 4 月 25 日晚 9 点 复习 Protected 可以被子类 / 同一包中的类访问, 不能被其他类访问 弱化的 private 同时赋予 package access class MyType { public int i; public double d; public
More informationMicrosoft PowerPoint - 4. 数组和字符串Arrays and Strings.ppt [兼容模式]
Arrays and Strings 存储同类型的多个元素 Store multi elements of the same type 数组 (array) 存储固定数目的同类型元素 如整型数组存储的是一组整数, 字符数组存储的是一组字符 数组的大小称为数组的尺度 (dimension). 定义格式 : type arrayname[dimension]; 如声明 4 个元素的整型数组 :intarr[4];
More informationuntitled
1 Outline 數 料 數 數 列 亂數 練 數 數 數 來 數 數 來 數 料 利 料 來 數 A-Z a-z _ () 不 數 0-9 數 不 數 SCHOOL School school 數 讀 school_name schoolname 易 不 C# my name 7_eleven B&Q new C# (1) public protected private params override
More informationC/C++语言 - C/C++数据
C/C++ C/C++ Table of contents 1. 2. 3. 4. char 5. 1 C = 5 (F 32). 9 F C 2 1 // fal2cel. c: Convert Fah temperature to Cel temperature 2 # include < stdio.h> 3 int main ( void ) 4 { 5 float fah, cel ;
More informationMicrosoft Word - 把时间当作朋友(2011第3版)3.0.b.06.doc
2 5 8 11 0 13 1. 13 2. 15 3. 18 1 23 1. 23 2. 26 3. 28 2 36 1. 36 2. 39 3. 42 4. 44 5. 49 6. 51 3 57 1. 57 2. 60 3. 64 4. 66 5. 70 6. 75 7. 83 8. 85 9. 88 10. 98 11. 103 12. 108 13. 112 4 115 1. 115 2.
More informationFY.DOC
高 职 高 专 21 世 纪 规 划 教 材 C++ 程 序 设 计 邓 振 杰 主 编 贾 振 华 孟 庆 敏 副 主 编 人 民 邮 电 出 版 社 内 容 提 要 本 书 系 统 地 介 绍 C++ 语 言 的 基 本 概 念 基 本 语 法 和 编 程 方 法, 深 入 浅 出 地 讲 述 C++ 语 言 面 向 对 象 的 重 要 特 征 : 类 和 对 象 抽 象 封 装 继 承 等 主
More information新版 明解C言語入門編
328, 4, 110, 189, 103, 11... 318. 274 6 ; 10 ; 5? 48 & & 228! 61!= 42 ^= 66 _ 82 /= 66 /* 3 / 19 ~ 164 OR 53 OR 164 = 66 ( ) 115 ( ) 31 ^ OR 164 [] 89, 241 [] 324 + + 4, 19, 241 + + 22 ++ 67 ++ 73 += 66
More informationFun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc
References (Section 5.2) Hsuan-Tien Lin Deptartment of CSIE, NTU OOP Class, March 15-16, 2010 H.-T. Lin (NTU CSIE) References OOP 03/15-16/2010 0 / 22 Fun Time (1) What happens in memory? 1 i n t i ; 2
More information尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 是 有 别 于 C++,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 像 Java 这 样 纯 粹 的 面 向 对 象 语 言 中, 所 有
玩 转 Object 不 理 解, 就 无 法 真 正 拥 有 歌 德 按 其 实 而 审 其 名, 以 求 其 情 ; 听 其 言 而 查 其 累, 无 使 放 悖 ( 根 据 实 际 明 辨 名 称, 以 便 求 得 真 实 情 况 ; 听 取 言 辞 后 弄 明 它 的 类 别, 不 让 它 混 淆 错 乱 ) 三 玩 转 Object 大 围 山 人 玩 转 Object...1 1. 通
More informationC
C 2017 3 14 1. 2. 3. 4. 2/95 C 1. 3/95 C I 1 // talkback.c: 2 #include 3 #include 4 #define DENSITY 62.4 5 int main(void) 6 { 7 float weight, volume; 8 int size; 9 unsigned long letters;
More informationC C
C C 2017 3 8 1. 2. 3. 4. char 5. 2/101 C 1. 3/101 C C = 5 (F 32). 9 F C 4/101 C 1 // fal2cel.c: Convert Fah temperature to Cel temperature 2 #include 3 int main(void) 4 { 5 float fah, cel; 6 printf("please
More informationuntitled
3 C++ 3.1 3.2 3.3 3.4 new delete 3.5 this 3.6 3.7 3.1 3.1 class struct union struct union C class C++ C++ 3.1 3.1 #include struct STRING { typedef char *CHARPTR; // CHARPTR s; // int strlen(
More information新・解きながら学ぶC言語
330!... 67!=... 42 "... 215 " "... 6, 77, 222 #define... 114, 194 #include... 145 %... 21 %... 21 %%... 21 %f... 26 %ld... 162 %lf... 26 %lu... 162 %o... 180 %p... 248 %s... 223, 224 %u... 162 %x... 180
More informationCHAPTER 1
CHAPTER 1 1-1 System Development Life Cycle; SDLC SDLC Waterfall Model Shelly 1995 1. Preliminary Investigation 2. System Analysis 3. System Design 4. System Development 5. System Implementation and Evaluation
More information1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F
1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET 2.0 2.0.NET Framework.NET Framework 2.0 ( 3).NET Framework 2.0.NET Framework ( System ) o o o o o o Boxing UnBoxing() o
More informationC/C++ - 文件IO
C/C++ IO Table of contents 1. 2. 3. 4. 1 C ASCII ASCII ASCII 2 10000 00100111 00010000 31H, 30H, 30H, 30H, 30H 1, 0, 0, 0, 0 ASCII 3 4 5 UNIX ANSI C 5 FILE FILE 6 stdio.h typedef struct { int level ;
More informationOOP with Java 通知 Project 4: 5 月 2 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 5 月 2 日晚 9 点 复习 Java 包 创建包 : package 语句, 包结构与目录结构一致 使用包 : import restaurant/ - people/ - Cook.class - Waiter.class - tools/ - Fork.class - Table.class
More informationMicrosoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
More informationJava Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream Class java.io.datainptstream (extends) FilterInputStream InputStream Obj
Message Transition 5-1 5-2 DataInputStream Class 5-3 DataOutputStream Class 5-4 PrintStream Class 5-5 (Message Transition) (Exercises) Java Access 5-1 Server Client Client Server Server Client 5-2 DataInputStream
More information02
Thinking in C++: Volume One: Introduction to Standard C++, Second Edition & Volume Two: Practical Programming C++ C C++ C++ 3 3 C C class C++ C++ C++ C++ string vector 2.1 interpreter compiler 2.1.1 BASIC
More informationMicrosoft Word - 第3章.doc
Java C++ Pascal C# C# if if if for while do while foreach while do while C# 3.1.1 ; 3-1 ischeck Test() While ischeck while static bool ischeck = true; public static void Test() while (ischeck) ; ischeck
More information新・明解C言語入門編『索引』
!... 75!=... 48 "... 234 " "... 9, 84, 240 #define... 118, 213 #include... 148 %... 23 %... 23, 24 %%... 23 %d... 4 %f... 29 %ld... 177 %lf... 31 %lu... 177 %o... 196 %p... 262 %s... 242, 244 %u... 177
More informationOOP with Java 通知 Project 4: 5 月 2 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 4: 5 月 2 日晚 9 点 复习 Protected 可以被子类 / 同一包中的类访问, 不能被其他类访问 弱化的 private 同时赋予 package access class MyType { public int i; public double d; public char
More information( CIP) /. :, ( ) ISBN TP CIP ( 2005) : : : : * : : 174 ( A ) : : ( 023) : ( 023)
( CIP) /. :, 2005. 2 ( ) ISBN 7-5624-3339-9.......... TP311. 1 CIP ( 2005) 011794 : : : : * : : 174 ( A ) :400030 : ( 023) 65102378 65105781 : ( 023) 65103686 65105565 : http: / /www. cqup. com. cn : fxk@cqup.
More informationMicrosoft Word - 新1-12.doc
实训 5 面向对象编程练习 实训 5 面向对象编程练习 5.1 实训目的 通过编程和上机实验理解 Java 语言是如何体现面向对象编程基本思想 以及如何创建类 和对象 了解成员变量和成员方法的特性 5.2 实训要求 编写一个体现面向对象思想的程序 编写一个创建对象和使用对象的方法的程序 5.3 实训内容 5.3.1 创建对象并使用对象 1 定义一个 Person 类 可以在应用程序中使用该类 成员属性
More informationSDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基
开放数据处理服务 ODPS SDK SDK 概要 使用 Maven 的用户可以从 Maven 库中搜索 "odps-sdk" 获取不同版本的 Java SDK: 包名 odps-sdk-core odps-sdk-commons odps-sdk-udf odps-sdk-mapred odps-sdk-graph 描述 ODPS 基础功能的主体接口, 搜索关键词 "odpssdk-core" 一些
More informationpython内存管理
Python 级内存管理 - xiaorui.cc Object-specific allocators [ int ] [ dict ] [ list ]... [ string ] Python core +3 [ Python's object allocator ]
More informationCHAPTER VC#
1. 2. 3. 4. CHAPTER 2-1 2-2 2-3 2-4 VC# 2-5 2-6 2-7 2-8 Visual C# 2008 2-1 Visual C# 0~100 (-32768~+32767) 2 4 VC# (Overflow) 2-1 2-2 2-1 2-1.1 2-1 1 10 10!(1 10) 2-3 Visual C# 2008 10! 32767 short( )
More information尽 管 Java 语 言 是 在 C++ 语 言 基 础 上 发 展 起 来 的, 但 与 C++ 不 同,Java 是 一 种 纯 粹 的 面 向 对 象 语 言 (Object-oriented language) 在 Java 世 界 中, 所 有 事 物 都 是 Object 1. 通 过
玩 转 Object 不 理 解, 就 无 法 真 正 拥 有 歌 德 按 其 实 而 审 其 名, 以 求 其 情 ; 听 其 言 而 查 其 累, 无 使 放 悖 ( 根 据 实 际 明 辨 名 称, 以 便 求 得 真 实 情 况 ; 听 取 言 辞 后 弄 明 它 的 类 别, 不 让 它 混 淆 错 乱 ) 三 玩 转 Object 大 围 山 人 玩 转 Object...1 1. 通
More informationC/C++ - 字符输入输出和字符确认
C/C++ Table of contents 1. 2. getchar() putchar() 3. (Buffer) 4. 5. 6. 7. 8. 1 2 3 1 // pseudo code 2 read a character 3 while there is more input 4 increment character count 5 if a line has been read,
More informationC++ 程式設計
C C 料, 數, - 列 串 理 列 main 數串列 什 pointer) 數, 數, 數 數 省 不 不, 數 (1) 數, 不 數 * 料 * 數 int *int_ptr; char *ch_ptr; float *float_ptr; double *double_ptr; 數 (2) int i=3; int *ptr; ptr=&i; 1000 1012 ptr 數, 數 1004
More informationC/C++ 语言 - 循环
C/C++ Table of contents 7. 1. 2. while 3. 4. 5. for 6. 8. (do while) 9. 10. (nested loop) 11. 12. 13. 1 // summing.c: # include int main ( void ) { long num ; long sum = 0L; int status ; printf
More informationCC213
: (Ken-Yi Lee), E-mail: feis.tw@gmail.com 177 [P179] (1) - [P181] [P182] (2) - for [P183] (3) - switch [P184] [P187] [P189] [P194] 178 [ ]; : : int var; : int var[3]; var 2293620 var[0] var[1] 2293620
More information38 47995529 威 福 髮 藝 店 桃 園 市 蘆 竹 區 中 山 里 福 祿 一 街 48 號 地 下 一 樓 50,000 獨 資 李 依 純 105/04/06 府 經 登 字 第 1059003070 號 39 47995534 宏 品 餐 飲 桃 園 市 桃 園 區 信 光 里 民
1 08414159 惠 鴻 眼 鏡 行 桃 園 市 中 壢 區 福 德 里 中 華 路 一 段 186 號 1 樓 30,000 獨 資 宋 耀 鴻 105/04/27 府 經 登 字 第 1059003866 號 2 17891110 承 元 冷 氣 空 調 工 程 行 桃 園 市 桃 園 區 中 德 里 國 際 路 1 段 98 巷 50 號 2 樓 之 4 200,000 獨 資 詹 安 平
More information《C语言程序设计》教材习题参考答案
教材名称 : C 语言程序设计 ( 第 1 版 ) 黄保和 江弋编著清华大学出版社 ISBN:978-7-302-13599-9, 红色封面 答案制作时间 :2011 年 2 月 -5 月 一 选择题 1. 设已定义 int a, * p, 下列赋值表达式中正确的是 :C)p=&a 2. 设已定义 int x,*p=&x;, 则下列表达式中错误的是 :B)&*x 3. 若已定义 int a=1,*b=&a;,
More informationchap07.key
#include void two(); void three(); int main() printf("i'm in main.\n"); two(); return 0; void two() printf("i'm in two.\n"); three(); void three() printf("i'm in three.\n"); void, int 标识符逗号分隔,
More informationPs22Pdf
C ( CIP) C /. :, 2001. 7 21 ISBN 7-5624 -2355-5. C........ C. TP312 CIP ( 2001 ) 034496 C * * : 7871092 1 /16 : 14. 25 : 356 20017 1 20017 1 : 1 6 000 ISBN 7-5624-2355-5 / TP311 : 21. 00 C, C,,,, C,, (
More informationChapter 9: Objects and Classes
Fortran Algol Pascal Modula-2 BCPL C Simula SmallTalk C++ Ada Java C# C Fortran 5.1 message A B 5.2 1 class Vehicle subclass Car object mycar public class Vehicle extends Object{ public int WheelNum
More information電機工程系認可證照清單 2011/7/1
南 台 科 技 大 學 電 機 工 程 系 專 業 證 照 課 程 實 施 要 點 96 年 10 月 05 日 系 務 會 議 通 過 100 年 06 月 30 日 系 務 會 議 修 正 通 過 101 年 06 月 21 日 系 務 會 議 修 正 通 過 一 本 系 為 提 升 學 生 的 專 業 技 能, 特 訂 定 本 辦 法 二 實 施 對 象 : 本 系 日 間 部 96 學 年
More informationMicrosoft PowerPoint - course2.ppt
Java 程 式 設 計 基 礎 班 (2) 莊 坤 達 台 大 電 信 所 網 路 資 料 庫 研 究 室 Email: doug@arbor.ee.ntu.edu.tw Class 2 1 回 顧 Eclipse 使 用 入 門 Class 2 2 Lesson 2 Java 程 式 語 言 介 紹 Class 2 3 Java 基 本 知 識 介 紹 大 小 寫 有 差 (Case Sensitive)
More information全国计算机技术与软件专业技术资格(水平)考试
全 国 计 算 机 技 术 与 软 件 专 业 技 术 资 格 ( 水 平 ) 考 试 2009 年 下 半 年 程 序 员 下 午 试 卷 ( 考 试 时 间 14:00~16:30 共 150 分 钟 ) 请 按 下 述 要 求 正 确 填 写 答 题 纸 1. 在 答 题 纸 的 指 定 位 置 填 写 你 所 在 的 省 自 治 区 直 辖 市 计 划 单 列 市 的 名 称 2. 在 答
More information《C语言程序设计》第2版教材习题参考答案
教材 C 语言程序设计 ( 第 2 版 ) 清华大学出版社, 黄保和, 江弋编著 2011 年 10 月第二版 ISBN:978-7-302-26972-4 售价 :35 元 答案版本 本习题答案为 2012 年 2 月修订版本 一 选择题 1. 设已定义 int a, * p, 下列赋值表达式中正确的是 :C)p = &a A. *p = *a B. p = *a C.p = &a D. *p =
More informationエスポラージュ株式会社 住所 : 東京都江東区大島 東急ドエルアルス大島 HP: ******************* * 关于 Java 测试试题 ******
******************* * 关于 Java 测试试题 ******************* 問 1 运行下面的程序, 选出一个正确的运行结果 public class Sample { public static void main(string[] args) { int[] test = { 1, 2, 3, 4, 5 ; for(int i = 1 ; i System.out.print(test[i]);
More information_汪_文前新ok[3.1].doc
普 通 高 校 本 科 计 算 机 专 业 特 色 教 材 精 选 四 川 大 学 计 算 机 学 院 国 家 示 范 性 软 件 学 院 精 品 课 程 基 金 青 年 基 金 资 助 项 目 C 语 言 程 序 设 计 (C99 版 ) 陈 良 银 游 洪 跃 李 旭 伟 主 编 李 志 蜀 唐 宁 九 李 涛 主 审 清 华 大 学 出 版 社 北 京 i 内 容 简 介 本 教 材 面 向
More informationJava java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,
http://debut.cis.nctu.edu.tw/~chi Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0, : POSITIVE_INFINITY NEGATIVE_INFINITY
More informationOOP with Java 通知 Project 7, 6 月 14 日晚 9 点 本周四上机课正常进行 答疑 本周三, 周五下午 1:00 3:00, 理科楼 B911 6 月 12 日考试 ( 随堂 ) 下午 1:00-3:00 教书院 218
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 7, 6 月 14 日晚 9 点 本周四上机课正常进行 答疑 本周三, 周五下午 1:00 3:00, 理科楼 B911 6 月 12 日考试 ( 随堂 ) 下午 1:00-3:00 教书院 218 OOP with Java 题目类型 : 选择 : 30% 问答 : 30% 编程 :
More informationMicrosoft Word - CPE考生使用手冊160524.docx
大 學 程 式 能 力 檢 定 (CPE) 考 生 使 用 手 冊 2016 年 5 月 24 日 這 份 手 冊 提 供 給 參 加 CPE 檢 定 考 試 的 考 生 內 容 包 含 考 試 環 境 的 使 用, 以 及 解 題 時 所 使 用 I/O 的 基 本 知 識 1. 如 欲 報 名 參 加 CPE 考 試, 請 先 於 CPE 網 站 完 成 帳 號 註 冊, 然 後 再 報 名 該
More information概述
OPC Version 1.6 build 0910 KOSRDK Knight OPC Server Rapid Development Toolkits Knight Workgroup, eehoo Technology 2002-9 OPC 1...4 2 API...5 2.1...5 2.2...5 2.2.1 KOS_Init...5 2.2.2 KOS_InitB...5 2.2.3
More informationuntitled
不 料 料 例 : ( 料 ) 串 度 8 年 數 串 度 4 串 度 數 數 9- ( ) 利 數 struct { ; ; 數 struct 數 ; 9-2 數 利 數 C struct 數 ; C++ 數 ; struct 省略 9-3 例 ( 料 例 ) struct people{ char name[]; int age; char address[4]; char phone[]; int
More informationGenerated by Unregistered Batch DOC TO PDF Converter , please register! 浙江大学 C 程序设计及实验 试题卷 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:3
浙江大学 C 程序设计及实验 试题卷 2002-2003 学年春季学期考试时间 : 2003 年 6 月 20 日上午 8:30-10:30 注意 : 答题内容必须写在答题卷上, 写在本试题卷上无效 一. 单项选择题 ( 每题 1 分, 共 10 分 ) 1. 下列运算符中, 优先级最低的是 A.
More informationMicrosoft Word - Mobile Trading User Manual-updated
輝 利 市 - 流 動 交 易 平 台 使 用 說 明 目 錄 第 一 章 第 二 章 登 入 股 票 交 易 功 能 2.1 落 盤 功 能 2.2 查 詢 交 易 進 展 2.3 取 消 交 易 / 更 改 交 易 2.4 報 價 組 合 及 倉 底 第 三 章 參 考 資 訊 3.1 戶 口 結 餘 3.2 即 時 報 價 3.3 本 地 指 數 3.4 十 大 升 跌 3.5 特 惠 積 分
More informationMicrosoft Word - 11900電腦軟體設計.doc
技 能 檢 定 規 範 之 一 一 九 電 腦 軟 體 行 政 院 勞 工 委 員 會 職 業 訓 練 局 編 印 軟 體 技 術 士 技 能 檢 定 規 範 目 錄 一 軟 體 技 術 士 技 能 檢 定 規 範 說 明... 1 二 丙 級 軟 體 技 術 士 技 能 檢 定 規 範... 3 三 乙 級 軟 體 技 術 士 技 能 檢 定 規 範... 5 四 甲 級 軟 體 技 術 士 技
More informationWWW PHP Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2
WWW PHP 2003 1 Comments Literals Identifiers Keywords Variables Constants Data Types Operators & Expressions 2 Comments PHP Shell Style: # C++ Style: // C Style: /* */ $value = $p * exp($r * $t); # $value
More informationC C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40
C C trio@seu.edu.cn C C C C The Most Beautiful Language and Most Dangerous Language in the Programming World! C 2 C C C 4 C 40 30 10 Project 30 C Project 3 60 Project 40 Week3 C Week5 Week5 Memory & Pointer
More informationC/C++ - 函数
C/C++ Table of contents 1. 2. 3. & 4. 5. 1 2 3 # include # define SIZE 50 int main ( void ) { float list [ SIZE ]; readlist (list, SIZE ); sort (list, SIZE ); average (list, SIZE ); bargragh
More information1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10
Java V1.0.1 2007 4 10 1 4 1.1 4 1.2..4 2..4 2.1..4 3.4 3.1 Java.5 3.1.1..5 3.1.2 5 3.1.3 6 4.6 4.1 6 4.2.6 5 7 5.1..8 5.1.1 8 5.1.2..8 5.1.3..8 5.1.4..9 5.2..9 6.10 6.1.10 6.2.10 6.3..10 6.4 11 7.12 7.1
More information, 即 使 是 在 昏 暗 的 灯 光 下, 她 仍 然 可 以 那 么 耀 眼 我 没 有 地 方 去, 你 会 带 着 我 么 杜 晗 像 是 在 嘲 笑 一 般, 嘴 角 的 一 抹 冷 笑 有 着 不 适 合 这 个 年 龄 的 冷 酷 和 无 情, 看 着 江 华 的 眼 神 毫 无 温
爱 情 飞 过 苍 凉 / 作 者 :18758265241 1 红 色 格 子 的 旅 行 箱, 在 湿 漉 漉 地 上 发 出 刺 啦 刺 啦 的 声 音, 那 么 刺 耳, 就 像 是 此 刻 杜 晗 的 里 一 样, 烦 躁 而 不 安 就 这 样 走 出 来 了,18 年 禁 锢 自 己 的 地 方 就 在 身 后, 杜 晗 手 指 关 节 泛 白, 紧 紧 地 拉 着 旅 行 箱, 走
More informationuntitled
A, 3+A printf( ABCDEF ) 3+ printf( ABCDEF ) 2.1 C++ main main main) * ( ) ( ) [ ].* ->* ()[] [][] ** *& char (f)(int); ( ) (f) (f) f (int) f int char f char f(int) (f) char (*f)(int); (*f) (int) (
More informationGuava学习之Resources
Resources 提供提供操作 classpath 路径下所有资源的方法 除非另有说明, 否则类中所有方法的参数都不能为 null 虽然有些方法的参数是 URL 类型的, 但是这些方法实现通常不是以 HTTP 完成的 ; 同时这些资源也非 classpath 路径下的 下面两个函数都是根据资源的名称得到其绝对路径, 从函数里面可以看出,Resources 类中的 getresource 函数都是基于
More informationEJB-Programming-3.PDF
:, JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Value Object Design Pattern J2EE Design Patterns Value Object Value Object Factory J2EE EJB Test Client
More information書本介紹
班 級 經 營 期 末 報 告 組 員 : 幼 三 甲 4A0I0030 蔡 依 璇 4A0I0048 蘇 家 儀 4A0I0096 張 容 嫣 4A0I0098 袁 少 潔 書 本 介 紹 閱 讀 對 象 : 小 學 低 年 級 的 老 師 新 生 家 長 有 意 從 事 小 學 者 及 關 心 教 育 品 質 的 社 會 人 士 內 容 : 1. 教 師 如 何 成 功 有 效 地 經 營 低
More information6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C C C51 C51 ANSI C MCS-51 C51 ANSI C C C51 bit Byte bit sbit
6 C51 ANSI C Turbo C C51 Turbo C C51 C51 C51 C51 C51 C51 C51 C51 C51 6.1 C51 6.1.1 C51 C51 ANSI C MCS-51 C51 ANSI C C51 6.1 6.1 C51 bit Byte bit sbit 1 0 1 unsigned char 8 1 0 255 Signed char 8 11 128
More informationMicrosoft PowerPoint - 5. 指针Pointers.ppt [兼容模式]
指针 Pointers 变量指针与指针变量 Pointer of a variable 变量与内存 (Variables and Memory) 当你声明一个变量时, 计算机将给该变量一个内存, 可以存储变量的值 当你使用变量时, 计算机将做两步操作 : - 根据变量名查找其对应的地址 ; - 通过地址对该地址的变量内容进行读 (retrieve) 或写 (set) 变量的地址称为变量的指针! C++
More informationC/C++ - 字符串与字符串函数
C/C++ Table of contents 1. 2. 3. 4. 1 char C 2 char greeting [50] = " How " " are " " you?"; char greeting [50] = " How are you?"; 3 printf ("\" Ready, go!\" exclaimed John."); " Ready, go!" exclaimed
More informationC
C 2017 4 1 1. 2. while 3. 4. 5. for 6. 2/161 C 7. 8. (do while) 9. 10. (nested loop) 11. 12. 3/161 C 1. I 1 // summing.c: 2 #include 3 int main(void) 4 { 5 long num; 6 long sum = 0L; 7 int status;
More informationuntitled
1 1.1 1.2 1.3 1.4 1.5 ++ 1.6 ++ 2 BNF 3 4 5 6 7 8 1.2 9 1.2 IF ELSE 10 1.2 11 1.2 12 1.3 Ada, Modula-2 Simula Smalltalk-80 C++, Objected Pascal(Delphi), Java, C#, VB.NET C++: C OOPL Java: C++ OOPL C# C++
More informationC/C++ - 结构体、共用体、枚举体
C/C++ Table of contents 1. 2. 3. 4. 5. 6. 7. 8. 1 C C (struct) C 2 C C (struct) C 2 i // book.c: # include < stdio.h> # define MAX_ TITLE 41 # define MAX_ AUTHOR 31 struct book { char title [ MAX_ TITLE
More information提问袁小兵:
C++ 面 试 试 题 汇 总 柯 贤 富 管 理 软 件 需 求 分 析 篇 1. STL 类 模 板 标 准 库 中 容 器 和 算 法 这 部 分 一 般 称 为 标 准 模 板 库 2. 为 什 么 定 义 虚 的 析 构 函 数? 避 免 内 存 问 题, 当 你 可 能 通 过 基 类 指 针 删 除 派 生 类 对 象 时 必 须 保 证 基 类 析 构 函 数 为 虚 函 数 3.
More information没有幻灯片标题
指针作为函数参数 : 原因 : 1 需要修改一个或多个值,( 用 return 语句不能解决问题 ) 2 执行效率的角度 使用方法 : 在函数原型以及函数首部中需要声明能够接受指针值的形参, 具体的写法为 : 数据类型 * 形参名 如果有多个指针型形参, 则用逗号分隔, 例如 : void swap(int *p1, int *p2) 它说明了形参 p1 p2 是指向整型变量的指针 在函数调用时,
More informationMicrosoft PowerPoint - 06 - ShengYang Presentation Slides_240609
沈 阳 水 务 一 体 化 发 展 的 探 索 水 允 办 简 行 各 资 许 表 要 业 位 很 源 我 示 介 的 嘉 荣 周 代 热 绍 基 宾 幸, 表 烈 一 本 再 女 并 沈 的 下 情 次 士 有 阳 祝 沈 况 来 : 们 机 水 贺 阳 到! 会 务 的 美 先 下 与 集 城 丽 生 面 各 团 市 的, 们 位 对 概 狮 : 我 交 活 况 城 向 流 动 和 大 参 在
More information(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit
Tomcat Web JUnit Cactus JUnit Java Cactus JUnit 26.1 JUnit Java JUnit JUnit Java JSP Servlet JUnit Java Erich Gamma Kent Beck xunit JUnit boolean JUnit Java JUnit Java JUnit Java 26.1.1 JUnit JUnit How
More informationMicrosoft Word - CIN-DLL.doc
6.3. 调 用 动 态 链 接 库 (DLL) 相 对 于 CIN 来 讲,NI 更 推 荐 用 户 使 用 DLL 来 共 享 基 于 文 本 编 程 语 言 开 发 的 代 码 除 了 共 享 或 重 复 利 用 代 码, 开 发 人 员 还 能 利 用 DLL 封 装 软 件 的 功 能 模 块, 以 便 这 些 模 块 能 被 不 同 开 发 工 具 利 用 在 LabVIEW 中 使 用
More information( ) ( ) ( ) S = { s 0, s 1, s 2,..., s M 1 } (1.1-1) M = S (1.1-2) a a, a,..., a,... (1.1-3) 0, 1 2 t p = p s ) (1.1-4) i ( i M 1 pi i= 0 = 1 (1.1-5) M 1 1 H ( S) = p log i (1.1-6) i pi M 1 i= 0 L = p
More information