OOP with Java 通知 Project 7 :6 月 27 日晚 9 点 6 月 14 日复习 6 月 21 日考试 答疑 6 月 20 日 13 : : 00 理科楼 B911
|
|
- 阿畴 郁
- 5 years ago
- Views:
Transcription
1 OOP with Java Yuanbin Wu
2 OOP with Java 通知 Project 7 :6 月 27 日晚 9 点 6 月 14 日复习 6 月 21 日考试 答疑 6 月 20 日 13 : : 00 理科楼 B911
3
4 abstract class demo { public int a; demo() { a = 10; abstract public void set(); abstract fnal public void get(); class Test extends demo { public void set(int a) { this.a = a; fnal public void get() { System.out.println("a = " + a); public static void main(string[] args) { Test obj = new Test(); obj.set(20); obj.get();
5 class Test { public static void main (String[] args) { try { int a = 0; System.out.println ("a = " + a + "\n"); int b = 20 / a; System.out.println ("b = " + b); catch(arithmeticexception e) { System.out.println ("Divide by zero error"); fnally { System.out.println ("inside the fnally block");
6 public class Test { private int x = 1; private int y = 2; private static int z = 3; public static void main(string[] args) { int x = 4; int y = 5; int z = 6; new Test().new Inner().init(); class Inner{ void init(){ System.out.println(x + " " + y + " " +z);
7 interface Foo{ int x = 10; public class Test { public static void main(string[] args) { Foo.x = 20; System.out.println(Foo.x);
8 1. 定义一个 LinkedList, 其中包含 String 对象. 2. 编写方法遍历该 LinkedList.
9 复习 I/O 流 InputStream/Reader read() OutputStream/Writer write() 抽象 : 数据的来源 / 数据的目的地 ByteArrayStream, FileStream StringStream ObjectStream
10 import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; public class CopyBytes { public static void main(string[] args) throws IOException { FileInputStream in = null; FileOutputStream out = null; try { in = new FileInputStream("xanadu.txt"); out = new FileOutputStream("outagain.txt"); int c; while ((c = in.read())!= -1) out.write(c); fnally { if (in!= null) in.close(); if (out!= null) out.close();
11 装饰器 FilterInputStream/FilterOutputStream BufferedInputStream DataInputStream FileInputStream fn = new FileInputStream("xanadu.txt"); BufferedInputStream bf = new BufferedInputStream(fn); DataInputStream din = new DataInputStream(bf); din.read(); din.readint(); din.readdouble(); FileOutputStream fout = new FileOutputStream("xanadu.txt"); BufferedOutputStream bf = new BufferedOutputStream(fout); DataOutputStream dout = new DataOutputStream(bf); dout.write(1); dout.writeint(10); dout.writedouble(3.14);
12 复习 InputStream ByteArrayInputStream FileInputStream StringBufferInputStream FilterInputStream BufferdInputStream DataInputStream 装饰器
13 OOP with Java 运行时类型信息 泛型
14 RTTI 运行时类型信息 RunTime Type Information (RTTI) Class 类 每一个类都包含一个 Class 类的对象 该对象包含该类的信息 类名字 类的有哪些方法 类的有哪些成员
15 RTTI 每个类的静态成员 所有对象共享一个 Class 对象 每个对象调用 getclass() 获得 Class 类的对象 String s = hello ; Class c = s.getclass(); 每个类通过.class 获得 Class 类的对象 Class c = String.class
16 RTTI Class 类的方法 getname() getinterfaces() getsuperclass() newinstance()
17 public class ToyTest { interface A { interface B { interface C { class Toy { Toy() { Toy(int i) { class FancyToy extends Toy implements A, B, C { FancyToy() { super(1); static void printinfo(class c) { System.out.println("Class name: " + c.getname() ); System.out.println( Is interface? + c.isinterface()); System.out.println("Simple name: " + c.getsimplename()); System.out.println("Canonical name : " + c.getcanonicalname()); public static void main(string[] args) { Class c = null; try { c = Class.forName("FancyToy"); catch(classnotfoundexception e) { System.out.println("Can t fnd FancyToy");System.exit(1); printinfo(c); for(class face : c.getinterfaces()) printinfo(face); Class up = c.getsuperclass(); Object obj = null; try { // Requires default constructor: obj = up.newinstance(); catch(instantiationexception e) { System.out.println("Cannot instantiate"); System.exit(1); catch(illegalaccessexception e) { System.out.println("Cannot access"); System.exit(1); printinfo(obj.getclass());
18 RTTI RTTI 的用途 给定 Object 引用, 判断它的类型 (Downcasting) String s = new String( hello ); Object o = s; String type = o.getclass().getname(); String t = (String)o;
19 泛型 容器 new ArrayList(); class Apple { private static long counter; private fnal long id = counter++; public long id() { return id; class Orange { public class ApplesAndOrangesWithoutGenerics { public static void main(string[] args) { ArrayList apples = new ArrayList(); for(int i = 0; i < 3; i++) apples.add(new Apple()); // Not prevented from adding an Orange to apples: apples.add(new Orange()); for(int i = 0; i < apples.size(); i++) ((Apple)apples.get(i)).id(); // Orange is detected only at run time
20 泛型 类型安全的容器 new ArrayList<Apple>(); public class ApplesAndOrangesWithGenerics { public static void main(string[] args) { ArrayList<Apple> apples = new ArrayList<Apple>(); for(int i = 0; i < 3; i++) apples.add(new Apple()); // Compile error! // apples.add(new Orange()); for(int i = 0; i < apples.size(); i++) apples.get(i).id(); for(apple c: apples) System.out.println(c.id());
21 泛型 不同类型间的相互替代? Upcasting 与多态 Class A { void f (A arg) { // f(new A()); Class A { Class B { void f (A arg) { // f(new B()); Class A { Class B { Class C extends A { void f (A arg) { // f(new C());
22 泛型 不同类型间的相互替代? 泛型 : 更灵活的方式
23 基本概念 泛型 (generics) 在定义类的成员和方法时, 类型为可变参数 class MyType {? member = null; void f (? arg) { //
24 基本概念 语法 class MyType {? member = null; void f (? arg) { // class MyType<T> { T member = null; <T> void f (T arg) { //
25 Example: A simple Holder class class Apple { public class Holder { private Apple a; public Holder(Apple a) { this.a = a; public void set(apple a) { this.a = a; public Apple get() { return a; public static void main(string[] args) { Holder h = new Holder(new Apple()); Apple a = h.get(); // h.set("not an Apple"); // Error // h.set(1); // Error
26 Example: A simple Holder class class Apple { public class Holder<T> { private T a; public Holder(T a) { this.a = a; public void set(t a) { this.a = a; public T get() { return a; public static void main(string[] args) { Holder<String> hs = new Holder<String>(new String( hello )); String s = hs.get(); Holder<Integer> hi = new Holder<Integer>(1); int I = hi.get(); Holder<Apple> h = new Holder<Apple>(new Apple()); Apple a = h.get(); // h.set("not an Apple"); // Error // h.set(1); // Error
27 Example: A simple Holder class class Apple { public class Holder<T> { private T a; public Holder(T a) { this.a = a; public void set(t a) { this.a = a; public T get() { return a; class Apple { public class Holder { private Object a; public Holder(Object a) { this.a = a; public void set(object a) { this.a = a; public Object get() { return a; public static void main(string[] args) { Holder<Apple> h = new Holder<Apple>( new Apple()); Apple a = h.get(); public static void main(string[] args) { Holder h = new Holder(new Apple()); Apple a = (Apple)h.get();
28 基本概念 方法 形参 实参 类型参数
29 Example: A tuple library Tuple 不可变数组 ( 数组元素不可变 ) 用途 : 函数返回多个值 Data transfer object
30 Example: A tuple library public class TwoTuple<A,B> { public fnal A frst; public fnal B second; public TwoTuple(A a, B b) { frst = a; second = b; public String tostring() { return "(" + frst + ", " + second + ")";
31 Example: A tuple library public class ThreeTuple<A,B,C> extends TwoTuple<A,B> { public fnal C third; public ThreeTuple(A a, B b, C c) { super(a, b); third = c; public String tostring() { return "(" + frst + ", " + second + ", " + third +")"; public class FourTuple<A,B,C,D> extends ThreeTuple<A,B,C> { public fnal D four; public ThreeTuple(A a, B b, C c, D d) { super(a, b, c); third = d; public String tostring() { return "(" + frst + ", " + second + ", " + third + "," + four + ")";
32 Example: A tuple library class Apple { class Orange { public class TupleTest { static TwoTuple<String,Integer> f() { return new TwoTuple<String,Integer>("hi", 47); // Autoboxing static ThreeTuple<Apple,String,Integer> g() { return new ThreeTuple<Apple, String, Integer>(new Apple(), "hi", 47); static FourTuple<Orange,Apple,String,Integer> h() { return new FourTuple<Orange,Apple,String,Integer>(new Orange(), new Apple(), "hi", 47); public static void main(string[] args) { TwoTuple<String,Integer> ttsi = f(); System.out.println(ttsi); // ttsi.frst = "there"; // Compile error: fnal System.out.println(g()); System.out.println(h());
33 泛型接口 带有类型参数的接口 public interface Generator<T> { T next(); public class Coffee { private static long counter = 0; private fnal long id = counter++; public String tostring() { return getclass().getsimplename() + " " + id; public class Latte extends Coffee { public class Mocha extends Coffee { public class Cappuccino extends Coffee { public class Americano extends Coffee { public class Breve extends Coffee {
34 import java.util.*; public class CoffeeGenerator implements Generator<Cofee> { private Class[] types = { Latte.class, Mocha.class, Cappuccino.class, Americano.class, Breve.class, ; private static Random rand = new Random(47); private int size = 0; public CoffeeGenerator() { public CoffeeGenerator(int sz) { size = sz; public Coffee next() { try { return (Cofee) types[rand.nextint(types.length)].newinstance(); // Report programmer errors at run time: catch(exception e) { throw new RuntimeException(e); public static void main(string[] args) { CoffeeGenerator gen = new CoffeeGenerator(); for(int i = 0; i < 5; i++) System.out.println(gen.next());
35 // public class CoffeeGenerator implements Generator<Cofee> public class Fibonacci implements Generator<Integer> { private int count = 0; public Integer next() { return fb(count++); private int fb(int n) { if(n < 2) return 1; return fb(n-2) + fb(n-1); public static void main(string[] args) { Fibonacci gen = new Fibonacci(); for(int i = 0; i < 18; i++) System.out.print(gen.next() + " ");
36 泛型方法 方法的参数, 返回值带有类型参数 语法 public <T> void f(t x) { // <T> 说明该方法带有类型参数 T 需要放在返回值说明之前
37 泛型方法 public class GenericMethods { public <T> void f(t x) { System.out.println(x.getClass().getName()); public static void main(string[] args) { GenericMethods gm = new GenericMethods(); gm.f(""); gm.f(1); gm.f(1.0); gm.f(1.0f); gm.f( c ); gm.f(gm); 方法的类型参数可以与类的类型参数无关 public class GenericMethods<E> { E member; public <T> void f(t x) { System.out.println(x.getClass().getName());
38 类型推理 编译器推理出类型变量的值 Import java.util.*; public class New { public static <K, V> Map<K, V> build() { return new HashMap<K, V>(); public static void main(string []args){ Map<String, List<String>> s = New.build(); 1. 由 Map<String, List<String>> s = New.build(); 推断出 build() 方法中的 K=String, V=List<String> 2. 可以通过语法明确泛型方法调用时的类型参数 Map<String, List<String>> s = New.<String, List<String>>Map(); // Diamond ArrayList<String> s = new ArrayList<>(); HashMap<String, Integer> h = new HashMap<>();
39 小结 泛型类 泛型接口 public class TwoTuple<A, B> { //... 泛型方法 public interface Generator<T> { T next(); public <T> void f(t x) { //
40 public class Generators { public static <T> Collection<T> fll(collection<t> coll, Generator<T> gen, int n) { for(int i = 0; i < n; i++) coll.add(gen.next()); return coll; public static void main(string[] args) { Collection<Coffee> coffee = fll(new ArrayList<Coffee>(), new CoffeeGenerator(), 4); for(coffee c : coffee) System.out.println(c); Collection<Integer> fnumbers = fll(new ArrayList<Integer>(), new Fibonacci(), 12); for(int i : fnumbers) System.out.print(i + ", ");
41 Type Erasure 当给定不同的类型参数时, 泛型的类型是否相同? class A { class B extends A{ public class Test { public static void main(string []args){ ArrayList<String> strlist = new ArrayList<>(); ArrayList<Integer> intl = strlist; ArrayList<B> blist = new ArrayList<>(); ArrayList<A> alist = blist; 编译错误! ArrayList<String>, ArrayList<Integer>, ArrayList<B>, ArrayList<A> 是不同类型!
42 Type Erasure 当给定不同的类型参数时, 泛型的类型是否相同? Class Object import java.util.*; public class ErasedTypeEquivalence { public static void main(string[] args) { Class c1 = new ArrayList<String>().getClass(); Class c2 = new ArrayList<Integer>().getClass(); System.out.println(c1 == c2); 输出 : true!
43 Type Erasure import java.util.*; class Frob { class Fnorkle { class Quark<Q> { class Particle<POSITION,MOMENTUM> { 输出 : [E] [K, V] [Q] [POSITION, MOMENTUM] public class LostInformation { public static void main(string[] args) { List<Frob> list = new ArrayList<Frob>(); Map<Frob,Fnorkle> map = new HashMap<Frob,Fnorkle>(); Quark<Fnorkle> quark = new Quark<Fnorkle>(); Particle<Long,Double> p = new Particle<Long,Double>(); System.out.println(Arrays.toString(list.getClass().getTypeParameters())); System.out.println(Arrays.toString(map.getClass().getTypeParameters())); System.out.println(Arrays.toString(quark.getClass().getTypeParameters())); System.out.println(Arrays.toString(p.getClass().getTypeParameters()));
44 Type Erasure 泛型是如何实现的? ArrayList<String> 与 ArrayList <Integer> 的区别在哪里?
45 Type Erasure 类型擦除 (Type Erasure), T 仅作为占位符, 不包含任何具体类型的信息 所有 T 类型的对象引用最终实现为 Object 对象引用
46 Type Erasure class HasF { public void f() { System.out.println("HasF.f()"); class Manipulator<T> { private T obj; public Manipulator(T x) { obj = x; // Error: cannot fnd symbol: method f(): public void manipulate() { obj.f(); public class Manipulation { public static void main(string[] args) { HasF hf = new HasF(); Manipulator<HasF> manipulator = new Manipulator<HasF>(hf); manipulator.manipulate();
47 Type Erasure public class Erased<T> { private fnal int SIZE = 100; public void f(object arg) { if(arg instanceof T) { T var = new T(); // compile error // compile error T[] array = new T[SIZE]; // compile error
48 Type Erasure Type Erasure 实现原理 1: 所有引用最后都变为 Object 引用 编译器自动添加 Downcasting 代码 class Apple { public class Holder<T> { private T a; public Holder(T a) { this.a = a; public void set(t a) { this.a = a; public T get() { return a; class Apple { public class Holder { private Object a; public Holder(Object a) { this.a = a; public void set(object a) { this.a = a; public Object get() { return a; public static void main(string[] args) { Holder<Apple> h = new Holder<Apple>( new Apple()); Apple a = h.get(); public static void main(string[] args) { Holder h = new Holder(new Apple()); Apple a = (Apple)h.get(); 生成相同的机器代码编译器在 get() 返回处自动添加了类型转换代码
49 Type Erasure Type Erasure 的实现原理 2: 编译器只做静态检查 class A { class B extends A{ public class Test { public static void main(string []args){ ArrayList<String> strlist = new ArrayList<>(); ArrayList<Integer> intl = strlist; ArrayList<B> blist = new ArrayList<>(); ArrayList<A> alist = blist; 1. 编译器通过静态检查报错 (ArrayList<String> 与 ArrayList<Integer> 类型不同 ) 2. 但实际存储中, 无论 <String> 还是 <Integer> 都存储的是 Object 类型的引用
50 Type Erasure Type Erasure 类型变量仅仅对编译器的静态检查有用 当通过静态检查, 所有类型参数被擦除
51 Type Erasure 如何解决 Type Erasure 带来的问题? Class 对象 public class Erased<T> { private fnal int SIZE = 100; public static void f() { T var = new T(); // compile error public class TypeCapture<T> { Class<T> kind; public TypeCapture(Class<T> kind){ this.kind = kind; public T f() { T r = null; try{ r = kind.newinstance(); catch (Exception e){ System.out.println("fail"); return r; public static void main(string []args) { TypeCapture<String> c = new TypeCapture<>(String.class); System.out.println(c.f());
52 Type Erasure 如何解决 Type Erasure 带来的问题? public class HasF { public void f() { System.out.println("HasF.f()"); class Manipulator<T> { private T obj; public Manipulator(T x) { obj = x; // Error: cannot fnd symbol: method f(): public void manipulate() { obj.f(); class Manipulator<T extends HasF> { private T obj; public Manipulator(T x) { obj = x; public void manipulate() { obj.f(); public class Manipulation { public static void main(string[] args) { HasF hf = new HasF(); Manipulator<HasF> manipulator = new Manipulator<HasF>(hf); manipulator.manipulate();
53 被限定的类型参数 限定类型参数的范围 语法 : class A <T extends B> { // 表示类型参数 T 只能是 B 类型或者 B 的子类型 作用 : 静态检查时, 可以合法引用 T 的方法 ( 但最终仍然是 Object ) 多个限定类型 class A <T extends B & C> { // 如果有类和接口, 类应该出现在第一个位置
54 被限定的类型参数 interface HasColor { java.awt.color getcolor(); class Colored<T extends HasColor> { T item; Colored(T item) { this.item = item; T getitem() { return item; // The bound allows you to call a method: java.awt.color color() { return item.getcolor(); class Dimension { public int x, y, z; // Multiple bounds: class ColoredDimension<T extends Dimension & HasColor> { T item; ColoredDimension(T item) { this.item = item; T getitem() { return item; java.awt.color color() { return item.getcolor(); int getx() { return item.x; int gety() { return item.y; int getz() { return item.z;
55 通配符 class Fruit { class Apple extends Fruit{ class Orange extends Fruit{ public class Test { public static void main(string []args){ List<Apple> alist = new ArrayList<Apple>(); // compile error // List<Fruit> fist = new ArrayList<Apple>(); 如何表达 ArrayList 中的元素是 Fruit 的某个子类?
56 通配符 class Fruit { class Apple extends Fruit{ class Orange extends Fruit{ public class Test { public static void main(string []args){ List<Apple> alist = new ArrayList<Apple>(); // compile error // List<Fruit> fist = new ArrayList<Apple>(); List<? extends Fruit> fist = new ArrayList<Apple>(); // Compile Error: can t add any type of object: // fist.add(new Apple()); // fist.add(new Fruit()); // fist.add(new Object()); fist.add(null); // Legal but uninteresting // We know that it returns at least Fruit: Fruit f = fist.get(0);
57 通配符 类型参数为某个 B 的子类型 具体是哪一个无法确定 List<? extends Fruit> 无法 add 任何对象 List 中存储的对象类型无法确定 可以 get 对象 Fruit 类型 <? extends B>
58 通配符 类型参数为某个 B 的父类型 具体是哪一个无法确定 List<? super Apple> 无法 get 任何对象 无法确定是哪个父类 <? super B> 可以 add Apple 的子类对象
59 import java.util.*; public class SuperTypeWildcards { static void writeto(list<? super Apple> apples) { apples.add(new Apple()); apples.add(new Jonathan()); // apples.add(new Fruit()); // Error
60 总结 Type Erasure 类型变量仅仅对编译器的静态检查有用 当通过静态检查, 所有类型参数被擦除 被限制的类型参数 通配符 class A <T extends B & C> { // <? extends B> <? super B>
OOP with Java 通知 Project 7 :6 月 14 日晚 9 点 6 月 5 日复习 6 月 12 日考试
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 7 :6 月 14 日晚 9 点 6 月 5 日复习 6 月 12 日考试 复习 I/O 流 InputStream/Reader read() OutputStream/Writer write() 抽象 : 数据的来源 / 数据的目的地 ByteArrayStream, FileStream
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 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: 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 6: 5 月 24 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 6: 5 月 24 日晚 9 点 复习 异常处理 语法 抛出异常 : throw 处理异常 : try, catch 异常对象 : Exception 类的子类 从方法中抛出异常 方法的异常说明 :throws 中断当前方法的执行, 返回抛出的异常对象, 在该方法的调用路径上寻找合适的
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 6: 5 月 30 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 6: 5 月 30 日晚 9 点 复习 异常处理 语法 抛出异常 : throw 处理异常 : try, catch 异常对象 : Exception 类的子类 从方法中抛出异常 方法的异常说明 :throws 中断当前方法的执行, 返回抛出的异常对象, 在该方法的调用路径上寻找合适的
More informationOOP with Java 通知 Project 6: 6 月 6 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 6: 6 月 6 日晚 9 点 复习 异常处理 语法 抛出异常 : throw 处理异常 : try, catch 异常对象 : Exception 类的子类 从方法中抛出异常 方法的异常说明 :throws 中断当前方法的执行, 返回抛出的异常对象, 在该方法的调用路径上寻找合适的
More informationchp6.ppt
Java 软 件 设 计 基 础 6. 异 常 处 理 编 程 时 会 遇 到 如 下 三 种 错 误 : 语 法 错 误 (syntax error) 没 有 遵 循 语 言 的 规 则, 出 现 语 法 格 式 上 的 错 误, 可 被 编 译 器 发 现 并 易 于 纠 正 ; 逻 辑 错 误 (logic error) 即 我 们 常 说 的 bug, 意 指 编 写 的 代 码 在 执 行
More informationEJB-Programming-4-cn.doc
EJB (4) : (Entity Bean Value Object ) JBuilder EJB 2.x CMP EJB Relationships JBuilder EJB Test Client EJB EJB Seminar CMP Entity Beans Session Bean J2EE Session Façade Design Pattern Session Bean Session
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 informationKillTest 质量更高 服务更好 学习资料 半年免费更新服务
KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 310-055Big5 Title : Sun Certified Programmer for the Java 2 Platform.SE 5.0 Version : Demo 1 / 22 1. 11. public static void parse(string str)
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 informationMac Java import com.apple.mrj.*;... public class MyFirstApp extends JFrame implements ActionListener, MRJAboutHandler, MRJQuitHandler {... public MyFirstApp() {... MRJApplicationUtils.registerAboutHandler(this);
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 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 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 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 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 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 information1: public class MyOutputStream implements AutoCloseable { 3: public void close() throws IOException { 4: throw new IOException(); 5: } 6:
Chapter 15. Suppressed Exception CH14 Finally Block Java SE 7 try-with-resources JVM cleanup try-with-resources JVM cleanup cleanup Java SE 7 Throwable getsuppressed Throwable[] getsuppressed() Suppressed
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 informationKillTest 质量更高 服务更好 学习资料 半年免费更新服务
KillTest 质量更高 服务更好 学习资料 http://www.killtest.cn 半年免费更新服务 Exam : 1Z0-854 Title : Java Standard Edition 5 Programmer Certified Professional Upgrade Exam Version : Demo 1 / 12 1.Given: 20. public class CreditCard
More informationMicrosoft Word - 01.DOC
第 1 章 JavaScript 简 介 JavaScript 是 NetScape 公 司 为 Navigator 浏 览 器 开 发 的, 是 写 在 HTML 文 件 中 的 一 种 脚 本 语 言, 能 实 现 网 页 内 容 的 交 互 显 示 当 用 户 在 客 户 端 显 示 该 网 页 时, 浏 览 器 就 会 执 行 JavaScript 程 序, 用 户 通 过 交 互 式 的
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 informationuntitled
4.1AOP AOP Aspect-oriented programming AOP 來說 AOP 令 理 Cross-cutting concerns Aspect Weave 理 Spring AOP 來 AOP 念 4.1.1 理 AOP AOP 見 例 來 例 錄 Logging 錄 便 來 例 行 留 錄 import java.util.logging.*; public class HelloSpeaker
More informationChapter 9: Objects and Classes
Java application Java main applet Web applet Runnable Thread CPU Thread 1 Thread 2 Thread 3 CUP Thread 1 Thread 2 Thread 3 ,,. (new) Thread (runnable) start( ) CPU (running) run ( ) blocked CPU sleep(
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 6: 5 月 24 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 6: 5 月 24 日晚 9 点 复习 内部类 定义在一个类的内部 class Outer{ class Inner{...... public class Parcel{ class Contents{ private int i = 11; public int value() {return
More information9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B
25 9 2008 9 M ICROEL ECTRON ICS & COMPU TER Vol. 25 No. 9 September 2008 J ava 1,2, 1,2, 1,2 (1, 330022 ; 2, 330022) :,. Apla - Java,,.. : PAR ;Apla - Java ; ;CMP ; : TP311 : A : 1000-7180 (2008) 09-0018
More informationMicrosoft PowerPoint - ch6 [相容模式]
UiBinder wzyang@asia.edu.tw UiBinder Java GWT UiBinder XML UI i18n (widget) 1 2 UiBinder HelloWidget.ui.xml: UI HelloWidgetBinder HelloWidget.java XML UI Owner class ( Composite ) UI XML UiBinder: Owner
More information2009年3月全国计算机等级考试二级Java语言程序设计笔试试题
2009 年 3 月 全 国 计 算 机 等 级 考 试 笔 试 试 卷 二 级 Java 语 言 程 序 设 计 ( 考 试 时 间 90 分 钟, 满 分 100 分 ) 一 选 择 题 ( 每 题 2 分, 共 70 分 ) 下 列 各 题 A) B) C) D) 四 个 选 项 中, 只 有 一 个 选 项 是 正 确 的 请 将 正 确 选 项 填 涂 在 答 题 卡 相 应 位 置 上,
More informationuntitled
1 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object 參 類 都 object 參 object Boxing 參 boxing
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 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 informationD C 93 2
D9223468 3C 93 2 Java Java -- Java UML Java API UML MVC Eclipse API JavadocUML Omendo PSPPersonal Software Programming [6] 56 8 2587 56% Java 1 epaper(2005 ) Java C C (function) C (reusability) eat(chess1,
More information詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入
100 年 特 種 考 試 地 方 政 府 公 務 人 員 考 試 試 題 等 別 : 三 等 考 試 類 科 : 資 訊 處 理 科 目 : 系 統 分 析 與 設 計 一 請 參 考 下 列 旅 館 管 理 系 統 的 使 用 案 例 圖 (Use Case Diagram) 撰 寫 預 約 房 間 的 使 用 案 例 規 格 書 (Use Case Specification), 繪 出 入
More informationjavaexample-02.pdf
n e w. s t a t i c s t a t i c 3 1 3 2 p u b l i c p r i v a t e p r o t e c t e d j a v a. l a n g. O b j e c t O b j e c t Rect R e c t x 1 y 1 x 2 y 2 R e c t t o S t r i n g ( ) j a v a. l a n g. O
More information软件工程文档编制
实训抽象类 一 实训目标 掌握抽象类的定义 使用 掌握运行时多态 二 知识点 抽象类的语法格式如下 : public abstract class ClassName abstract void 方法名称 ( 参数 ); // 非抽象方法的实现代码 在使用抽象类时需要注意如下几点 : 1 抽象类不能被实例化, 实例化的工作应该交由它的子类来完成 2 抽象方法必须由子类来进行重写 3 只要包含一个抽象方法的抽象类,
More informationJavaIO.PDF
O u t p u t S t ream j a v a. i o. O u t p u t S t r e a m w r i t e () f l u s h () c l o s e () public abstract void write(int b) throws IOException public void write(byte[] data) throws IOException
More informationuntitled
1 Outline 料 類 說 Tang, Shih-Hsuan 2006/07/26 ~ 2006/09/02 六 PM 7:00 ~ 9:30 聯 ives.net@gmail.com www.csie.ntu.edu.tw/~r93057/aspnet134 度 C# 力 度 C# Web SQL 料 DataGrid DataList 參 ASP.NET 1.0 C# 例 ASP.NET 立
More informationuntitled
1 Outline ArrayList 類 列類 串類 類 類 例 理 MSDN Library MSDN Library 量 例 參 列 [ 說 ] [] [ 索 ] [] 來 MSDN Library 了 類 類 利 F1 http://msdn.microsoft.com/library/ http://msdn.microsoft.com/library/cht/ Object object
More information前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii
前言 C# C# C# C C# C# C# C# C# microservices C# More Effective C# More Effective C# C# C# C# Effective C# 50 C# C# 7 Effective vii C# 7 More Effective C# C# C# C# C# C# Common Language Runtime CLR just-in-time
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 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 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 information内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌
语 言 程 序 设 计 郑 莉 胡 家 威 编 著 清 华 大 学 逸 夫 图 书 馆 北 京 内 容 简 介 本 书 是 一 本 关 于 语 言 程 序 设 计 的 教 材, 涵 盖 了 语 言 的 基 本 语 法 和 编 程 技 术, 其 中 包 含 了 作 者 对 语 言 多 年 开 发 经 验 的 总 结, 目 的 是 让 初 学 的 读 者 感 受 到 语 言 的 魅 力, 并 掌 握 语
More information1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6
www.brainysoft.net 1.JasperReport ireport...4 1.1 JasperReport...4 1.2 ireport...4 2....4 2.1 JDK...4 2.1.1 JDK...4 2.1.2 JDK...5 2.1.3 JDK...5 2.2 ant...6 2.2.1 ant...6 2.2.2 ant...6 2.3 JasperReport...7
More informationMicrosoft Word - ch04三校.doc
4-1 4-1-1 (Object) (State) (Behavior) ( ) ( ) ( method) ( properties) ( functions) 4-2 4-1-2 (Message) ( ) ( ) ( ) A B A ( ) ( ) ( YourCar) ( changegear) ( lowergear) 4-1-3 (Class) (Blueprint) 4-3 changegear
More informationGuava学习之Resources
Resources 提供提供操作 classpath 路径下所有资源的方法 除非另有说明, 否则类中所有方法的参数都不能为 null 虽然有些方法的参数是 URL 类型的, 但是这些方法实现通常不是以 HTTP 完成的 ; 同时这些资源也非 classpath 路径下的 下面两个函数都是根据资源的名称得到其绝对路径, 从函数里面可以看出,Resources 类中的 getresource 函数都是基于
More information(6) 要 求 付 款 管 理 员 从 预 订 表 中 查 询 距 预 订 的 会 议 时 间 两 周 内 的 预 定, 根 据 客 户 记 录 给 满 足 条 件 的 客 户 发 送 支 付 余 款 要 求 (7) 支 付 余 款 管 理 员 收 到 客 户 余 款 支 付 的 通 知 后, 检
2016 年 上 半 年 软 件 设 计 师 考 试 真 题 ( 下 午 题 ) 下 午 试 题 试 题 一 ( 共 15 分 ) 阅 读 下 列 说 明 和 图, 回 答 问 题 1 至 问 题 4, 将 解 答 填 入 答 题 纸 的 对 应 栏 内 说 明 某 会 议 中 心 提 供 举 办 会 议 的 场 地 设 施 和 各 种 设 备, 供 公 司 与 各 类 组 织 机 构 租 用 场
More information《大话设计模式》第一章
第 1 章 代 码 无 错 就 是 优? 简 单 工 厂 模 式 1.1 面 试 受 挫 小 菜 今 年 计 算 机 专 业 大 四 了, 学 了 不 少 软 件 开 发 方 面 的 东 西, 也 学 着 编 了 些 小 程 序, 踌 躇 满 志, 一 心 要 找 一 个 好 单 位 当 投 递 了 无 数 份 简 历 后, 终 于 收 到 了 一 个 单 位 的 面 试 通 知, 小 菜 欣 喜
More informationMicrosoft PowerPoint - plan08.ppt
程 序 设 计 语 言 原 理 Principle of Programming Languages 裘 宗 燕 北 京 大 学 数 学 学 院 2012.2~2012.6 8. 面 向 对 象 为 什 么 需 要 面 向 对 象? OO 语 言 的 发 展 面 向 对 象 的 基 本 概 念 封 装 和 继 承 初 始 化 和 终 结 处 理 动 态 方 法 约 束 多 重 继 承 总 结 2012
More informationSwing-02.pdf
2 J B u t t o n J T e x t F i e l d J L i s t B u t t o n T e x t F i e l d L i s t J F r a m e 21 2 2 Swing C a n v a s C o m p o n e n t J B u t t o n AWT // ToolbarFrame1.java // java.awt.button //
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 informationjava2d-4.PDF
75 7 6 G r a d i e n t P a i n t B a s i c S t r o k e s e t P a i n t ( ) s e t S t o r k e ( ) import java.awt.*; import java.awt.geom.*; public class PaintingAndStroking extends ApplicationFrame { public
More informationIoC容器和Dependency Injection模式.doc
IoC Dependency Injection /Martin Fowler / Java Inversion of Control IoC Dependency Injection Service Locator Java J2EE open source J2EE J2EE web PicoContainer Spring Java Java OO.NET service component
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 information雲端 Cloud Computing 技術指南 運算 應用 平台與架構 10/04/15 11:55:46 INFO 10/04/15 11:55:53 INFO 10/04/15 11:55:56 INFO 10/04/15 11:56:05 INFO 10/04/15 11:56:07 INFO
CHAPTER 使用 Hadoop 打造自己的雲 8 8.3 測試 Hadoop 雲端系統 4 Nodes Hadoop Map Reduce Hadoop WordCount 4 Nodes Hadoop Map/Reduce $HADOOP_HOME /home/ hadoop/hadoop-0.20.2 wordcount echo $ mkdir wordcount $ cd wordcount
More information使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款
JAVA 程 序 设 计 ( 肆 ) 徐 东 / 数 学 系 使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款 使 用 Java class 代 表 保 险 箱 public class SaveBox 类 名 类 类 体 实 现 封 装 性 使 用 class SaveBox 代 表 保
More informationOOP with Java 通知 Project 3: 4 月 19 日晚 9 点
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 3: 4 月 19 日晚 9 点 复习 Upcasting 同一基类的不同子类可以被视为同一类型 ( 基类 ) 放宽类型一致性 简化接口 class A{ class B{ A a = new A(); B b = new B(); // A a = new B(); compile
More informationuntitled
Velocity 14 100061 315@pptph.com.cn http://www.pptph.com.cn 010-67129212 010-67129211 787 1092 1/16 22 535 1 0 000 2001 11 1 2001 11 1 ISBN 7-115-09828-X/TP 2577 32.00 01067129223 1 2 1 2 3 4 5 1 Velocity
More informationLearning Java
Java Introduction to Java Programming (Third Edition) Prentice-Hall,Inc. Y.Daniel Liang 2001 Java 2002.2 Java2 2001.10 Java2 Philip Heller & Simon Roberts 1999.4 Java2 2001.3 Java2 21 2002.4 Java UML 2002.10
More informationWWW PHP
WWW PHP 2003 1 2 function function_name (parameter 1, parameter 2, parameter n ) statement list function_name sin, Sin, SIN parameter 1, parameter 2, parameter n 0 1 1 PHP HTML 3 function strcat ($left,
More informationJava 1 Java String Date
JAVA SCJP Java 1 Java String Date 1Java 01 Java Java 1995 Java Java 21 Java Java 5 1-1 Java Java 1990 12 Patrick Naughton C++ C (Application Programming Interface API Library) Patrick Naughton NeXT Stealth
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 informationMicrosoft Word - 新1-12.doc
实训 5 面向对象编程练习 实训 5 面向对象编程练习 5.1 实训目的 通过编程和上机实验理解 Java 语言是如何体现面向对象编程基本思想 以及如何创建类 和对象 了解成员变量和成员方法的特性 5.2 实训要求 编写一个体现面向对象思想的程序 编写一个创建对象和使用对象的方法的程序 5.3 实训内容 5.3.1 创建对象并使用对象 1 定义一个 Person 类 可以在应用程序中使用该类 成员属性
More informationOOP with Java 通知 Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 学习使用文本编辑器 学习使用 cmd: Power shell 阅读参考资料
OOP with Java Yuanbin Wu cs@ecnu OOP with Java 通知 Project 2 提交时间 : 3 月 14 日晚 9 点 另一名助教 : 王桢 Email: 51141201063@ecnu.cn 学习使用文本编辑器 学习使用 cmd: Power shell 阅读参考资料 OOP with Java Java 类型 引用 不可变类型 对象存储位置 作用域 OOP
More informationMicrosoft Word - Learn Objective-C.doc
Learn Objective C http://cocoadevcentral.com/d/learn_objectivec/ Objective C Objective C Mac C Objective CC C Scott Stevenson [object method]; [object methodwithinput:input]; output = [object methodwithoutput];
More informationuntitled
1 行 行 行 行.NET 行 行 類 來 行 行 Thread 類 行 System.Threading 來 類 Thread 類 (1) public Thread(ThreadStart start ); Name 行 IsAlive 行 行狀 Start 行 行 Suspend 行 Resume 行 行 Thread 類 (2) Sleep 行 CurrentThread 行 ThreadStart
More information2009年9月全国计算机等级考试二级Java真题及答案
2009 年 9 月 全 国 计 算 机 等 级 考 试 二 级 Java 真 题 及 答 案 [ 录 入 者 :NCRE100 时 间 :2009-10-08 19:41:34 作 者 : 来 源 :NCRE100.com 浏 览 :1421 次 ] 2009 年 9 月 全 国 计 算 机 等 级 考 试 二 级 笔 试 试 卷 Java 语 言 程 序 设 计 ( 考 试 时 间 90 分 钟,
More informationStrings
Polymorphism and Virtual Functions Cheng-Chin Chiang Virtual Function Basics 多 型 (Polymorphism) 賦 予 一 個 函 數 多 種 意 涵, 存 在 於 同 一 類 別 之 內 祖 先 類 別 與 後 代 類 別 間 物 件 導 向 程 式 設 計 基 本 原 理 虛 擬 函 數 (Virtual Function)
More information2. AOP 底层技术实现 小风 Java 实战系列教程 关键词 : 代理模式 代理模型分为两种 : 1) 接口代理 (JDK 动态代理 ) 2) 子类代理 (Cglib 子类代理 ) 需求 :CustomerService 业务类, 有 save,update 方法, 希望在 save,updat
本章学习目标 小风 Java 实战系列教程 AOP 思想概述 AOP 底层技术实现 AOP 术语介绍 SpringAOP 的 XML 方式 HelloWorld SpringAOP 的 XML 方式配置细节 SpringAOP 的注解方式 SpringAOP 的零配置方式 1. AOP 思想概述 1.1. AOP 思想简介 1.2. AOP 的作用 2. AOP 底层技术实现 小风 Java 实战系列教程
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 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 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 information1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->
目录 1 大概思路... 1 2 创建 WebAPI... 1 3 创建 CrossMainController 并编写... 1 4 Nuget 安装 microsoft.aspnet.webapi.cors... 4 5 跨域设置路由... 4 6 编写 Jquery EasyUI 界面... 5 7 运行效果... 7 8 总结... 7 1 1 大概思路 创建 WebAPI 创建 CrossMainController
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 information基于ECO的UML模型驱动的数据库应用开发1.doc
ECO UML () Object RDBMS Mapping.Net Framework Java C# RAD DataSetOleDbConnection DataGrod RAD Client/Server RAD RAD DataReader["Spell"].ToString() AObj.XXX bug sql UML OR Mapping RAD Lazy load round trip
More information北 风 网 讲 师 原 创 作 品 ---- 仅 供 学 员 内 部 交 流 使 用 前 言 吾 尝 终 日 而 思 矣, 不 如 须 臾 之 所 学 也 ; 吾 尝 跂 而 望 矣, 不 如 登 高 之 博 见 也 登 高 而 招, 臂 非 加 长 也, 而 见
北 风 网 讲 师 原 创 作 品 ---- 仅 供 www.ibeifeng.com 学 员 内 部 交 流 使 用 前 言 吾 尝 终 日 而 思 矣, 不 如 须 臾 之 所 学 也 ; 吾 尝 跂 而 望 矣, 不 如 登 高 之 博 见 也 登 高 而 招, 臂 非 加 长 也, 而 见 者 远 ; 顺 风 而 呼, 声 非 加 疾 也, 而 闻 者 彰 假 舆 马 者, 非 利 足 也,
More information附录J:Eclipse教程
附 录 J:Eclipse 教 程 By Y.Daniel Liang 该 帮 助 文 档 包 括 以 下 内 容 : Eclipse 入 门 选 择 透 视 图 创 建 项 目 创 建 Java 程 序 编 译 和 运 行 Java 程 序 从 命 令 行 运 行 Java Application 在 Eclipse 中 调 试 提 示 : 在 学 习 完 第 一 章 后 使 用 本 教 程 第
More informationStrings
Inheritance Cheng-Chin Chiang Relationships among Classes A 類 別 使 用 B 類 別 學 生 使 用 手 機 傳 遞 訊 息 公 司 使 用 金 庫 儲 存 重 要 文 件 人 類 使 用 交 通 工 具 旅 行 A 類 別 中 有 B 類 別 汽 車 有 輪 子 三 角 形 有 三 個 頂 點 電 腦 內 有 中 央 處 理 單 元 A
More information<4D6963726F736F667420506F776572506F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>
程 序 设 计 实 习 INFO130048 3-2.C++ 面 向 对 象 程 序 设 计 重 载 继 承 多 态 和 聚 合 复 旦 大 学 计 算 机 科 学 与 工 程 系 彭 鑫 pengxin@fudan.edu.cn 内 容 摘 要 方 法 重 载 类 的 继 承 对 象 引 用 和 拷 贝 构 造 函 数 虚 函 数 和 多 态 性 类 的 聚 集 复 旦 大 学 计 算 机 科 学
More informationuntitled
1 .NET 利 [] [] 來 說 切 切 理 [] [ ] 來 說 拉 類 類 [] [ ] 列 連 Web 行流 來 了 不 不 不 流 立 行 Page 類 Load 理 Response 類 Write 料 Redirect URL Response.Write("!! ives!!"); Response.Redirect("WebForm2.aspx"); (1) (2) Web Form
More information27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f
27 1 Vol.27 No.1 CEMENTED CARBIDE 2010 2 Feb.2010!"!!!!"!!!!"!" doi:10.3969/j.issn.1003-7292.2010.01.011 OPC 1 1 2 1 (1., 412008; 2., 518052), OPC, WinCC VB,,, OPC ; ;VB ;WinCC Application of OPC Technology
More information主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new
ListView 自訂排版 主程式 : public class Main3Activity extends AppCompatActivity { ListView listview; // 先整理資料來源,listitem.xml 需要傳入三種資料 : 圖片 狗狗名字 狗狗生日 // 狗狗圖片 int[] pic =new int[]{r.drawable.dog1, R.drawable.dog2,
More informationjavac: 负 责 的 是 编 译 的 部 分, 当 执 行 javac 时, 会 启 动 java 的 编 译 器 程 序 对 指 定 扩 展 名 的.java 文 件 进 行 编 译 生 成 了 jvm 可 以 识 别 的 字 节 码 文 件 也 就 是 class 文 件, 也 就 是 ja
Java 基 础 知 识 总 结 一 :java 概 述 : 1,JDK:Java Development Kit,java 的 开 发 和 运 行 环 境,java 的 开 发 工 具 和 jre 2,JRE:Java Runtime Environment,java 程 序 的 运 行 环 境,java 运 行 的 所 需 的 类 库 +JVM(java 虚 拟 机 ) 3, 配 置 环 境 变
More informationmvc
Build an application Tutor : Michael Pan Application Source codes - - Frameworks Xib files - - Resources - ( ) info.plist - UIKit Framework UIApplication Event status bar, icon... delegation [UIApplication
More informationFileMaker 16 ODBC 和 JDBC 指南
FileMaker 16 ODBC JDBC 2004-2017 FileMaker, Inc. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc. FileMaker WebDirect FileMaker Cloud FileMaker,
More information在 ongodb 中实现强事务
在 ongodb 中实现强事务 600+ employees 2,000+ customers 13 offices worldwide 15,000,000+ Downloads RANK DBMS MODEL SCORE GROWTH (20 MO) 1. Oracle Rela+onal DBMS 1,442-5% 2. MySQL Rela+onal DBMS 1,294 2% 3.
More informationC 1 # include <stdio.h> 2 int main ( void ) { 4 int cases, i; 5 long long a, b; 6 scanf ("%d", & cases ); 7 for (i = 0;i < cases ;i ++) 8 { 9
201 201 21 ( ) 1. C pa.c, pb.c, 2. C++ pa.cpp, pb.cpp Compilation Error long long cin scanf Time Limit Exceeded 1: A 1 B 1 C 5 D RPG 10 E 10 F 1 G II 1 1 201 201 C 1 # include 2 int main ( void
More informationMicrosoft PowerPoint - L17_Inheritance_v4.pptx
C++ Programming Lecture 17 Wei Liu ( 刘 威 ) Dept. of Electronics and Information Eng. Huazhong University of Science and Technology May. 2015 Lecture 17 Chapter 20. Object-Oriented Programming: Inheritance
More informationINTRODUCTION TO COM.DOC
How About COM & ActiveX Control With Visual C++ 6.0 Author: Curtis CHOU mahler@ms16.hinet.net This document can be freely release and distribute without modify. ACTIVEX CONTROLS... 3 ACTIVEX... 3 MFC ACTIVEX
More information<4D F736F F F696E74202D20A1B64A617661B8DFBCB6BCBCCAF5A1B7B5DA31312E35BDB220B6AFCCACC0E0D0CDBCECB2E92E707074>
Java 高级技术 课程 Java 语言的高级特性 (8) 李戈 北京大学信息科学技术学院软件研究所 2008 年 5 月 11 日 运行期类型识别 RTTI ( Run-Time Type Identification ) 在运行期间, 识别一个对象的类型 运行期类型识别 RTTI 的三种方法 强制类型转换 利用 Class 对象 通过比较识别类型 (1) 利用强制类型转换判别运行期类型 class
More informationwhile ((ch = fr.read())!= -1) { System.out.print((char) ch); fr.close(); 例 3: 用 BufferedReader 读 TXT 文件 public class FileReaderDemo3 { public static v
第九章 Java I/O 流操作 实验目的 (1) 掌握文本文件的读写方法 (2) 掌握 InputStream OutputStream 的使用方法 (3) 熟悉 FileReader,BufferedReader,InputStreamReader 和 FileWriter, BufferedWriter, PrintWriter 的使用方法 ; 理解使用过滤流实现数据项的读写 :DataOutputStream,
More information基于CDIO一体化理念的课程教学大纲设计
Java 语 言 程 序 设 计 课 程 教 学 大 纲 Java 语 言 程 序 设 计 课 程 教 学 大 纲 一 课 程 基 本 信 息 1. 课 程 代 码 :52001CC022 2. 课 程 名 称 :Java 语 言 程 序 设 计 3. 课 程 英 文 名 称 :Java Programming 4. 课 程 类 别 : 理 论 课 ( 含 实 验 上 机 或 实 践 ) 5. 授
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 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 information6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM
CHAPTER 6 SQL SQL SQL 6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM 3. 1986 10 ANSI SQL ANSI X3. 135-1986
More information// 获取并集 // set1.addall(set2); // 获取交集 set1.retainall(set2); // 打印操作结果 set1.foreach(o -> System.out.println(o)); 运行结果如图 6-1 所示 图 6-1 运行结果 三 案例总结 1 Coll
第 6 章集合 案例 6-1 Collection 单列集合的操作 一 案例描述 1 考核知识点编号 :063006002~063006008 063006018 名称 :Collection 单列集合 Arrays 工具类 2 练习目标 掌握 Collection 单列集合方法的使用 3 需求分析 Collection 是所有单列集合的根接口, 在 Collection 中定义了单列集合 (List
More information