Properties prop = System.getProperties(); String os = prop.getProperty("os.name"); System.out.println(os);os.startWith("win") || os.startWith("Win")
分类:
编程语言 时间:
2014-10-27 19:02:05
阅读次数:
131
out.println("GET /shopping/index.html HTTP/1.1");//请求行 包括请求方式,文件路径, http协议版本(必写)请求头....out.println("Aceept: */*");//客户端能够处理的文件类型(不是必须)out.println("Hos...
分类:
Web程序 时间:
2014-10-27 17:33:43
阅读次数:
170
//被代理接口
interface ClothFactory{
public void productCloth();
}
//被代理类
class NikeClothFactory implements ClothFactory{
@Override
public void productCloth() {
System.out.println("Nike 生产衣服");
}
}...
分类:
其他好文 时间:
2014-10-27 15:43:54
阅读次数:
189
??
interface Work{
public void doWork();
}
class StudentWork implements Work{
@Override
public void doWork() {
System.out.println("student 写作业");
}
}
class TeacherWork implements Work{
@...
分类:
其他好文 时间:
2014-10-27 15:41:24
阅读次数:
140
package 斐波那契数列;public class fbnq {public static void main(String[] args){System.out.println(fibonacci(10));} // 递归实现方式 public static int fibonacci(in....
分类:
编程语言 时间:
2014-10-27 12:29:51
阅读次数:
215
复写(override),也叫重写、覆盖。当子类继承了父类的成员函数并需要对其函数功能进行修改时,此过程就叫复写。例子如下:class Person{ String name; void introduce(){ System.out.println(...
分类:
其他好文 时间:
2014-10-27 00:17:41
阅读次数:
140
先看代码class Person{ int age; String name; Person(){ System.out.println("Person的无参数构造函数"); } Person(int age,Strin...
分类:
其他好文 时间:
2014-10-26 22:41:21
阅读次数:
186
1 package com.lovo; 2 3 public class Test5 { 4 public static void main(String[] args) { 5 int[] f=new int[10]; 6 System.out.println("排序前...
分类:
其他好文 时间:
2014-10-26 21:16:53
阅读次数:
198
数组复制使我们在编程过程中常常要使用到的,在java中数组复制我们大概可以分为两种,一种是引用复制,另一种就是深度复制(复制后两个数组互不相干)。
下面我们就通过测试的方法来详细看看什么是引用复制和深度复制。
引用复制:
顾名思义就是其值是引用的,值得改变会随着被引用的对象改变。System.out.println("引用复制-----------------------------...
分类:
编程语言 时间:
2014-10-26 11:53:33
阅读次数:
202
继承继承的好处:子类拥有父类的所有属性和方法,peivate修饰的无效;实现代码复用class子类extends父类
例如:classDogextendsAnimal{
......
}
父类:
packagecom.imooc;
publicclassAnimal{
publicintage;
publicStringname;
publicvoideat(){
System.out.println("动物具..
分类:
编程语言 时间:
2014-10-26 06:56:33
阅读次数:
179