//装饰设计模式。//不修改原对象,对原有对象的功能进行增强。classPerson{voidchifan(){System.out.println("吃饭");}}classNewPerson{privatePersonp;NewPerson(Personp){this.p=p;}publicvoidnewChifan(){System.out.println("开胃酒");p.chifan();System.out.println("甜点..
分类:
其他好文 时间:
2016-07-10 06:32:27
阅读次数:
186
public class SuperClass{ public void printA(){ System.out.print("SuperClass-printA"); printB(); } public void printB(){ System.out.print("SuperClass-p ...
分类:
编程语言 时间:
2016-07-10 00:57:43
阅读次数:
190
今天偶然发现了IntelliJ中 创建main函数的快捷键,依次还有for循环,System.out.println(); 在编写代码的时候直接输入psv就会看到一个psvm的提示,此时点击tab键一个main方法就写好了。 psvm 也就是public static void main的首字母。 ...
分类:
其他好文 时间:
2016-07-09 22:09:35
阅读次数:
154
在Swift中,初次接触inout关键字以及它的用法,可能会让我们想起C/C++中的指针,但实际上Swift中inout只不过是按值传递,然后再写回原变量,而不是按引用传递: An in-out parameter has a value that is passed in to the funct ...
分类:
编程语言 时间:
2016-07-09 18:00:24
阅读次数:
423
问题: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and ...
分类:
其他好文 时间:
2016-07-09 14:53:16
阅读次数:
133
import java.util.Scanner; public class D1 { public static void main(String[] args) { Scanner input=new Scanner (System.in); System.out.println("输出互换前手 ...
分类:
其他好文 时间:
2016-07-09 14:43:39
阅读次数:
172
敲击sout+Tab会出现:System.out.println(); int(-2147483648, 2147483647) 当一个方法类型不是void时,那么我们不仅要考虑它正确时的返回值,错误时的返回值我们也要定义一下,如:return -1; 所以,当一个方法(method)返回-1,那么 ...
分类:
编程语言 时间:
2016-07-09 13:29:02
阅读次数:
291
假设源程序文件名为test.c。 1. 无选项编译链接 用法:#gcc test.c 作用:将test.c预处理、汇编、编译并链接形成可执行文件。这里未指定输出文件,默认输出为a.out。 2. 选项 -o 用法:#gcc test.c -o test 作用:将test.c预处理、汇编、编译并链接形 ...
分类:
系统相关 时间:
2016-07-09 12:02:49
阅读次数:
192
JSTL 核心标签库标签共有13个,功能上分为4类: 1.表达式控制标签:out、set、remove、catch 2.流程控制标签:if、choose、when、otherwise 3.循环标签:forEach、forTokens 4.URL操作标签:import、url、redirect ...
分类:
Web程序 时间:
2016-07-09 11:57:06
阅读次数:
213
多个返回值可以用ref或者out来实现 如 var b=string.Empty(); var c=string.Empty(); public bool Test(string a, out string b,ref string c) { return true; } 这样可以返回三个值:tru ...