摘要:        
public class Strategy {	public static void main(String[] args) { int [] array=new int[]{26,25,15,42,36,16,12}; IInfo test1=new BubbleSort(); //接口引用指向实    
阅读全文
 
        
            posted @ 2016-11-24 20:33
Heavy_dream
阅读(1377)
推荐(0)
        
 
		
    
        
        
摘要:        
配置路由端口的ip地址与打开(省略) 配置路由协议 router eigrp 100 network 211.1.1.0(网络号) 0.0.0.255(通配子掩) network 192.168.1.0 0.0.0.255 接下来NAT的配置 int+端口(出去) ip nat outside in    
阅读全文
 
        
            posted @ 2016-11-20 15:27
Heavy_dream
阅读(961)
推荐(0)
        
 
		
    
        
        
摘要:        
package com.chigoe;//房子类class House {	private int m;// 保存行数	private int n;// 保存列数	private int[][] a; public House() { // 无参构造方法 m = 10; n = 10; for (i    
阅读全文
 
        
            posted @ 2016-10-30 18:35
Heavy_dream
阅读(369)
推荐(0)
        
            
        
        
摘要:        
import java.util.Scanner; public class Calendar { public static void main(String[] args) { // 万年历 int year;// 保存输入的年 int month;// 保存输入的月 System.out.pr    
阅读全文
 
        
            posted @ 2016-10-30 16:03
Heavy_dream
阅读(285)
推荐(0)
        
 
		
    
        
        
摘要:        
连接access2003 字符串 下面给出个例子:看明白的扣1。 1、先演示下连接SQL数据库的: using System.Data.SqlClient;//sqlserver数据库命名空间 string connstr = "Data Source=localhost;Initial Catal    
阅读全文
 
        
            posted @ 2016-10-24 22:58
Heavy_dream
阅读(2287)
推荐(0)
        
 
		
    
        
            
        
         
        2016年11月30日
    
 
        
        
摘要:        
import java.text.DecimalFormat;import java.util.Scanner; public class TheAreaOfCircle {	public static void main(String[] args) { /*问题描述 给定圆的半径r,求圆的面积。    
阅读全文
 
        
            posted @ 2016-11-30 21:22
Heavy_dream
阅读(6565)
推荐(0)
        
            
        
        
摘要:        
(转载自玄影池扁舟) 做java项目的时候可能经常会遇到double类型变量保留小数的问题,下面便把我的经验做个简短的总结: java中double类型变量保留小数问题大体分两种情况: (一):小数点后面位数过长,四舍五入保留指定位数: 可以用以下代码实现: public class TestDem    
阅读全文
 
        
            posted @ 2016-11-30 21:16
Heavy_dream
阅读(2822)
推荐(0)
        
            
        
        
摘要:        
public class HeightDemo {	/** * 题目:一球从100米高度自由落下,每次落地后反跳回原高度的一半; * 再落下,求它在第10次落地时,共经过多少米?第10次反弹多高? */	public static void main(String[] args) { double     
阅读全文
 
        
            posted @ 2016-11-30 20:33
Heavy_dream
阅读(162)
推荐(0)
        
 
		
    
        
            
        
         
        2016年11月29日
    
 
        
        
摘要:        
import java.util.Scanner; public class Fibonacci { public static void main(String[] args) { int n; for (;;) {// 无限循环 Scanner sc = new Scanner(System.i    
阅读全文
 
        
            posted @ 2016-11-29 22:24
Heavy_dream
阅读(176)
推荐(0)
        
 
		
    
        
            
        
         
        2016年11月25日
    
 
        
        
摘要:        
public class SoldierDemo { public static void main(String[] args) { /*Soldier test1=new Army("张三"); test1.action(); Soldier test2=new Navy("李四"); test    
阅读全文
 
        
            posted @ 2016-11-25 16:18
Heavy_dream
阅读(268)
推荐(0)
        
            
        
        
摘要:        
public class Strategy {public static void main(String[] args) {int [] array=new int[]{26,25,15,42,36,16,12};IInfo test1=new BubbleSort(); //接口引用指向实现了此    
阅读全文
 
        
            posted @ 2016-11-25 13:53
Heavy_dream
阅读(183)
推荐(0)
        
            
        
        
摘要:        
public class TemplateMethodDemo { public static void main(String[] args) { Teacher test=new Javatreacher("张三");//动态绑定 test.work(); Teacher test1=new D    
阅读全文
 
        
            posted @ 2016-11-25 11:58
Heavy_dream
阅读(256)
推荐(0)
        
            
        
        
摘要:        
作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例。这个类称为单例类。 单例模式的结构 单例模式的特点: 单例类只能有一个实例。 单例类必须自己创建自己的唯一实例。 单例类必须给所有其他对象提供这一实例。 饿汉式单例类 上面的例子中,在这个类被加载时,静态变    
阅读全文
 
        
            posted @ 2016-11-25 11:55
Heavy_dream
阅读(266)
推荐(0)
        
            
        
        
摘要:        
public class Factory { public static void main(String[] args) {//Client IFruit fruit=Factorytemp.getFruit("香蕉");//这里为什么要使用接口的类型,因为接口的引用可以接收实现此接口的类的实例     
阅读全文
 
        
            posted @ 2016-11-25 11:43
Heavy_dream
阅读(282)
推荐(0)