易截截图软件、单文件、免安装、纯绿色、仅160KB

Java中的枚举类型,enum

public class MyEnumTestMain {
public enum MyenumTest{red,blue,green,black}//定义枚举类型

public static void main(String[] args) {
MyenumTest mt = MyenumTest.red;//red相当于枚举的静态属性

switch(mt){
case red:
System.out.println("red");
break;
case blue:
System.out.println("blue");
break;
default:
System.out.println("其他");
}
}
}


相关文档:

Java中集合容器类List和Set的用法

List的用法
List包括List接口以及List接口的所有实现类。因为List接口实现了Collection接口,所以List接口拥有Collection接口提供的所有常用方法,又因为List是列表类型,所以List接口还提供了一些适合于自身的常用方法,如表1所示。
表1  List接口定义的常用方法及功能
从表1可以看出,List接口提供的适合于自身的 ......

IBM FileNet Content Java API 简介

2008 年 6 月 24 日
原文地址: http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0806wangys/
本文介绍 IBM FileNet P8 4.0 Platform 提供的 Content Java API。首先对 FileNet P8 Content Engine 和 API 进行概要介绍, 并说明了一些基本概念,随后详细介绍了 FileNet Content Engine提供的基于 EJB ......

学习记录——【转】java中打开explorer


 很我找了好久 终于找到了.....
以下是转文:
//--------------------------------------------------------------------------------------------------
方法很简单,调用explorer.exe就可以,
Runtime.getRuntime().exec(
             & ......

Java theory and practice

1. Multiply-Thread
Locks offer two primary features: mutual exclusion and visibility. Mutual exclusion means only one thread at a time may hold a given lock, so only one thread at a time will be using the shared data. Visibility is to ensure that changes made to shared data prior to releasing a lo ......

JAVA连接数据库大全

JAVA连接数据库大全
 
 
1.Oracle8/8i/9i数据库(thin模式)
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@localhost:1521:ts"; //ts为数据库的SID
String user="sa";
String password="";
Connection conn= DriverManager.getConnection(url,u ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号