上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 48 下一页
摘要: 简单工厂package com.lucas.ModelSimpleFactory;public abstract class Operation { public double A = 0; public double B = 0; public double getA() { return A; } public void setA(double a) { A = a; } public ... 阅读全文
posted @ 2013-05-16 11:50 helloweworld 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 组合关系(强拥有关系,生命周期相同,如鸟和翅膀)public class TestOne {}public class TestTwo { private TestOne test1; public TestTwo() { // TODO Auto-generated constructor stub test1 = new TestOne(); }}聚合关系(弱拥有关系,如公司和员工,员... 阅读全文
posted @ 2013-05-15 22:09 helloweworld 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Target.java package com.lucas.ModelAdapter;public abstract class Target { public void Request() { System.out.println("Target request!"); }}Adaptee.javapackage com.lucas.ModelAdapter;public class A... 阅读全文
posted @ 2013-05-15 21:33 helloweworld 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 这里我安装的是Amateras插件(其他试了很多插件没成功)。一、到下面网址下载Amaterashttp://sourceforge.jp/projects/amateras/releases/?package_id=4435二、解压下载的文件,将 3个*.jar文件 拷贝到 ..\eclipse\plugins 文件夹下。三、重启eclipse,ok!使用如下:1、"File"->"New"->"Other"->"AmaterasUML"->"Class diagram" 阅读全文
posted @ 2013-05-15 17:37 helloweworld 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 参考:http://blog.csdn.net/v_july_v/article/details/7382693 set/map/multiset/multimap都是基于RB-tree之上,所以有自动排序功能,而hash_set/hash_map/hash_multiset/hash_multimap都是基于hashtable之上,所以不含有自动排序功能,至于加个前缀multi_无非就是允许键值... 阅读全文
posted @ 2013-05-12 19:31 helloweworld 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-05-10 17:24 helloweworld 阅读(108) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;class A{ int a; virtual void aa() {}};class B : virtual public A{ int b;};class C : virtual public A{ int c;};class D : public B, public C{ int d;};int main(){ c... 阅读全文
posted @ 2013-05-10 17:10 helloweworld 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 普通类的sizeof 类比struct 注意字节对齐#include <iostream>using namespace std;class A{public: int data; char p;};int main(){ cout << sizeof (A) << endl; //字节对齐,输出8. return 0;}含有虚函数的类的sizeof#include <iostream>u... 阅读全文
posted @ 2013-05-09 21:42 helloweworld 阅读(225) 评论(0) 推荐(0) 编辑
摘要: //============================================================================// Name : HelloWorldcpp.cpp// Author : Lucas// Version :// Copyright : @Lucas// Description : Hello Worl... 阅读全文
posted @ 2013-05-08 12:36 helloweworld 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Effective C++ 条款33:明智地使用内联 1、inline就像register,只是对编译器的建议,编译器并不一定接受该建议。 2、“一般来说,实际编程时最初的原则是不要内联任何函数,除非函数确实很小很简单”。 3、构造和析构函数看起来短小,看起来很适合内联,其实不然! 因为编译器在构造、析构对象时做了很多事,增加了额外的代码,如 // 一个Derived构造函数的可能的实现 ... 阅读全文
posted @ 2013-05-08 11:44 helloweworld 阅读(534) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 48 下一页