m := make(map[string]int)m["Answer"] = 48v, ok := m["Answer"]fmt.Println("The value:", v, "Present?", ok)delete(m, "Answer")fmt.Println("The value:", ...
分类:
其他好文 时间:
2014-12-23 19:26:22
阅读次数:
160
首先来看看下面这段代码: public class Base { private int i=5; public Base(){ System.out.println("I come from "+this.getClass()+" i="+this.i); this.display(); } pu...
分类:
其他好文 时间:
2014-12-23 13:56:08
阅读次数:
86
package main
import (
"fmt"
)
type Encipher func(plaintext string) string
func main() {
p := "123"
s := GenEncryptionFunc(Test)
fmt.Println(s(p))
}
func GenEncryptionFunc(encrypt Encipher) ...
分类:
其他好文 时间:
2014-12-23 10:45:43
阅读次数:
155
package xu.jin;
import java.awt.print.Printable;
class Insect{
private int i=print("hello i");
Insect(){System.out.println("Insect"+i);}
{
System.out.println("1");
System.out.println("2");
}...
分类:
编程语言 时间:
2014-12-23 10:27:19
阅读次数:
250
1 class A 2 { 3 public A() 4 { 5 System.out.println("----------A 构造-------------"); 6 } 7 static 8 { 9 System.out.println("----------A 静态块-...
分类:
编程语言 时间:
2014-12-23 10:17:56
阅读次数:
172
如下代码:publicclassExample008{
publicstaticvoidmain(String[]args){
charx=‘X‘;
inti=0;
System.out.println(true?x:65535);//1
System.out.println(true?x:65536);//2
System.out.println(true?x:i);//3
System.out.println(false?0:x);//4
System.out.pr..
分类:
编程语言 时间:
2014-12-23 06:52:47
阅读次数:
187
Java中创建匿名线程主要集中就三中方式:Thread,Runnable,Handler去实现,下面分别介绍之~一、通过Thread来创建new Thread(){ public void run() { System.out.println("wytings1"); }}...
分类:
移动开发 时间:
2014-12-22 22:45:40
阅读次数:
193
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变量 3 private int x=1; 4 //定义外部类函数 5 public void methodOut(){ 6 System.out.println(...
分类:
编程语言 时间:
2014-12-22 22:37:13
阅读次数:
252
/** *九九乘法表啊 *12月21日 *逗号问题尚未解决 */ public class P105 { ?? ?public static void main(String[] args) ?? ?{ ?? ??? ?System.out.println("九九乘法表啊~~~"); ?? ??? ?int i...
分类:
其他好文 时间:
2014-12-22 11:26:01
阅读次数:
201
1.异常
异常是导致程序中断执行的一种指令流。public class TestException1
{
public static void main(String[] args)
{
int i = 10; //定义整型变量
int j =0 ; //定义整型变量
int temp = i/j ;
System.out.println("两个数字相除的结果:"...
分类:
编程语言 时间:
2014-12-22 09:34:10
阅读次数:
181