public class jiaoji { /** * @param args */ public static void main(String[] args) { String s1="abc"; String s2="abdgca"; System.out.println...
分类:
其他好文 时间:
2014-10-10 17:36:24
阅读次数:
164
class Singleton { private static Singleton instance = null; private Singleton() { System.out.println("Init the Singleton instance!"); ...
分类:
编程语言 时间:
2014-10-10 15:09:43
阅读次数:
174
本文重点关注静态块、非静态块、构造函数的加载顺序直接上代码:[java]view plaincopypackagetest.staticblock;publicclassA{/*父类构造方法*/publicA(){System.out.println("Aconstructor");}/*父类静态块...
分类:
编程语言 时间:
2014-10-10 13:08:44
阅读次数:
253
File file=new File("E:\\aa.jpg");
String fileName=file.getName();
String fileTyle=fileName.substring(fileName.lastIndexOf("."),fileName.length());
System.out.println(fileTyle);
程序运行效果图:...
分类:
编程语言 时间:
2014-10-09 20:49:27
阅读次数:
239
1 class Person { 2 private String name; 3 private int age; 4 public String getName() { 5 return this.name; 6 } 7 8 p...
分类:
其他好文 时间:
2014-10-09 14:03:43
阅读次数:
156
channel会阻塞,阻塞的时候系统会继续顺序调用其他goroutine,main()也是一个goroutine,只是最先被执行。 看一个代码: package main import ( "fmt" ) func display(msg string, c chan bool) { fmt.Println(ms...
分类:
其他好文 时间:
2014-10-09 13:26:08
阅读次数:
169
/**
* 角色
* @author stone
*
*/
public class Actor {
public Actor(String name) {
System.out.println("创建了角色: " + name);
}
public void load() {
System.out.println("角色加载");
}
public void u...
分类:
编程语言 时间:
2014-10-09 02:07:00
阅读次数:
224
// 完整显示日期时间 String str = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS")).format(new Date()); System.out.println(str); // 创建 Cal...
分类:
编程语言 时间:
2014-10-08 17:29:25
阅读次数:
316
public class QWE{ public static void main(String[] args){ //输出信息 System.out.println("\t\t\t欢迎使用我行我素购物管理系统");//输出系统名称 System.out.println("");//输出空行 Sy....
分类:
其他好文 时间:
2014-10-08 16:56:45
阅读次数:
201
[html]?view plaincopyprint? public?void?onWindowFocusChanged(boolean?hasFocus)?? ????{?? ????????//?TODO?Auto-generated?method?stub?? ????????System.out.println("h...
分类:
移动开发 时间:
2014-10-08 13:30:55
阅读次数:
204