黑马程序员入学blog ...
接着上一章的代码:
//车类
class Car{
//事物的公共属性使用成员变量描述。
String name; //名字的属性
String color; //颜色属性
int wheel; //轮子数
//事物的公共行为使用函数描述。
public void run(){
System.out.println...
分类:
编程语言 时间:
2015-08-19 00:40:36
阅读次数:
139
工厂模式主要用来封装对象的创建,有3种分类:简单工厂(simple factory)、工厂方法(factory method)、抽象工厂(abstract factory)。简单工厂包括3种组成元素:抽象产品、具体产品、具体工厂(简单工厂),结构图如下:C++实现://抽象产品class Car.....
分类:
其他好文 时间:
2015-08-18 21:15:39
阅读次数:
144
There is a funny car racing in a city with n junctions and m directed roads.The funny part is: each road is open and closed periodically. Each road is...
分类:
其他好文 时间:
2015-08-18 19:03:28
阅读次数:
174
Description精 明的小R每每开车出行总是喜欢走最快路线,而不是最短路线.很明显,每条道路的限速是小R需要考虑的关键问题.不过有一些限速标志丢失了,于是小R将不知 道能开多快.不过有一个合理的方法是进入这段道路时不改变速度行驶.你的任务就是计算从小R家(0号路口)到D号路口的最快路线.现在你...
分类:
其他好文 时间:
2015-08-18 01:07:02
阅读次数:
143
Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= "car", retur...
分类:
其他好文 时间:
2015-08-17 11:29:46
阅读次数:
234
Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
You have a car with an unlimited gas tank and it costs cost[i] of gas to travel fro...
分类:
其他好文 时间:
2015-08-16 23:08:44
阅读次数:
230
资料:汽车图片 和plist文件:两个模型//// Car.h// 汽车品牌//// Created by YaguangZhu on 15/8/16.// Copyright (c) 2015年 YaguangZhu. All rights reserved.//#import @inte...
分类:
移动开发 时间:
2015-08-16 15:02:16
阅读次数:
203
前言: 代理模式作为常见的设计模式之一,在项目开发中不可或缺。本文就尝试着揭开代理的神秘面纱,也欢迎各路人批评指正!1.如何实现代理:【假设有个关于汽车移动(move)的计时需求】 设计:Moveable接口,一个Car的实现类;两个代理CarTimer,TimeHandler.UML图如下: 1....
分类:
其他好文 时间:
2015-08-16 00:36:18
阅读次数:
164
Data Template:要做一个listBox,里面有车子的简单信息,点了里面的item后就会显示详细信息。car class: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using Sy...
自定义对象一、定义类或对象1.工厂方式创建对象car 1 var oCar = new Object; 2 oCar.color = "red"; 3 oCar.doors = 4; 4 oCar.mpg = 23; 5 oCar.showColor = function(){ 6 alert...
分类:
编程语言 时间:
2015-08-15 17:56:46
阅读次数:
114